Learnr

Learn Number Theory

Explore primes, divisibility and modular arithmetic from first proofs.

or browse all courses.

Free to start. Built from a single prompt. No credit card.

Number theory studies the integers, especially divisibility and prime numbers. Its elementary questions are easy to state and surprisingly deep, from why every integer factors uniquely into primes to why there are infinitely many primes. A first course covers divisibility, greatest common divisors and the Euclidean algorithm, the fundamental theorem of arithmetic, modular arithmetic and congruences, the Chinese remainder theorem, Fermat's little theorem and Euler's theorem, and Diophantine equations. These ideas also power modern cryptography such as RSA. Learnr builds a personalized number theory course and teaches it in short interactive lessons with lots of small proofs and computations.

How to learn Number Theory, step by step

  1. Get comfortable with divisibility proofs. Use the definition that a divides b when b = ak for some integer k, and prove simple statements like "if a divides b and b divides c, then a divides c." Precise definitions are the whole game in number theory.
  2. Study primes and unique factorization. Work through Euclid's proof that there are infinitely many primes and the proof of the fundamental theorem of arithmetic. Practice using prime factorizations to find gcds, lcms and the number of divisors.
  3. Master the Euclidean algorithm. Compute gcds by repeated division, then run the algorithm backward to write the gcd as a combination ax + by, which is Bezout's identity. Use it to solve linear Diophantine equations and find modular inverses.
  4. Learn modular arithmetic fluently. Treat congruence mod n as clock arithmetic, reduce large powers by repeated squaring, and solve linear congruences. Divisibility tests for 3, 9 and 11 make good first exercises.
  5. Prove and use the classic theorems. Learn Fermat's little theorem, Euler's theorem with the totient function and the Chinese remainder theorem, then use them to compute things like the last digits of huge powers. Short Learnr sessions help keep these tools ready.
  6. See the theory in action with RSA. Build a toy RSA system with small primes, encrypt and decrypt a number by hand, and explain why security depends on the difficulty of factoring large numbers.

What you'll learn

  • Prove results about divisibility, primes and greatest common divisors
  • Use the Euclidean algorithm and Bezout's identity
  • Compute and solve congruences in modular arithmetic
  • Apply the Chinese remainder theorem, Fermat's little theorem and Euler's theorem
  • Explain how number theory underlies RSA encryption

What's inside your Number Theory course

A sample path Learnr builds for Number Theory. Your real course adapts to your goal and level.

  • 1. Divisibility and the division algorithm
  • 2. Primes and the fundamental theorem of arithmetic
  • 3. GCD, the Euclidean algorithm and linear Diophantine equations
  • 4. Modular arithmetic and congruences
  • 5. Fermat, Euler and the Chinese remainder theorem
  • 6. Quadratic residues and cryptography

How long does it take to learn Number Theory?

An introductory number theory course takes about 3 to 4 months at 4 to 6 hours a week. If you are new to writing proofs, add a few weeks at the start. Contest-level problem solving takes considerably longer and benefits from regular practice.

What you need before you start

High school algebra and some comfort with proofs, especially induction and proof by contradiction. A discrete math or intro to proofs course is ideal preparation but not strictly required.

Common mistakes to avoid

  • Dividing both sides of a congruence by a number that shares a factor with the modulus, which is not allowed without adjusting the modulus.
  • Checking a few examples and treating that as proof. Number theory is full of patterns that hold for small cases and then fail.
  • Confusing gcd and lcm, or forgetting that 1 is neither prime nor composite.

How Learnr builds your course

Type your topic

Tell Learnr you want to learn Number Theory, or get as specific as you like.

Get a personalized course

Learnr instantly builds a full Number Theory course tailored to your goal and skill level.

Learn and level up

Move through bite-sized lessons and interactive practice, earning XP and keeping your streak.

Number Theory questions, answered

Is number theory useful or just pure math?

Both. It is one of the oldest branches of pure mathematics, and it also underpins public-key cryptography, error-correcting codes, hashing and random number generation used in computing.

What books are good for learning number theory?

Common choices include David Burton's Elementary Number Theory and Joseph Silverman's A Friendly Introduction to Number Theory for a gentle start, and Niven, Zuckerman and Montgomery's An Introduction to the Theory of Numbers for more depth.

Explore more courses

More math courses

See all math courses

Ready to learn Number Theory?

Start your free, personalized Number Theory course in seconds. .