maths.free › Number Theory

Number Theory

Primes, divisibility, gcd, modular arithmetic and sequences.

Lessons

The mathematics of whole numbers. Some of the oldest problems and the newest cryptography live here: factor a number into primes, run Euclid's algorithm, compute huge powers modulo a prime without ever writing the power down.

More lessons

Some of these lessons are adapted from open texts: OpenStax Contemporary Mathematics, Wikipedia. Each lesson page names its source and licence.

Symbols used here

Tap any symbol for the full definition, a picture, and what every letter in it means.

Questions people ask

Why are primes so important?

Every integer factors into primes in exactly one way, so primes are the atoms of multiplication. Cryptography relies on that factoring being easy to state and hard to do.

How do I tell whether a big number is prime?

Trial division up to the square root works for small numbers. For large ones, probabilistic tests (Miller-Rabin) give an answer that is wrong with negligible probability, and deterministic tests (AKS) exist but are slower.

Have a problem of your own?
Type it or draw it on the solver page: every step, a picture, the answer hidden until you ask.
Solve →

Other branches