Prime
A positive integer greater than 1 with no positive divisors except 1 and itself.
Algebra & Number · Accessible first encounter
Number theory investigates divisibility, primes, congruences, and integer equations. Its objects are familiar from elementary arithmetic, but its questions can be subtle enough to shape centuries of mathematics.
01 · Opening mystery
To find gcd(414, 662), listing every divisor would be unpleasant. The Euclidean algorithm repeatedly replaces the larger number by a remainder and quickly reaches the answer.
The algorithm works because subtracting a multiple of one number from the other does not change which integers divide them both. A computational shortcut is really an invariant.
Make a prediction. The laboratory is designed to challenge or refine it.
02 · Interactive laboratory
Enter two positive integers. Each row writes the larger number as a multiple of the smaller plus a remainder. The last nonzero remainder is the gcd.
03 · The big idea
If a = qb + r, then r = a − qb. Any number dividing both a and b also divides r. Conversely, any number dividing b and r also divides a = qb + r. Therefore gcd(a, b) = gcd(b, r).
This idea extends naturally to congruence. We write a ≡ b (mod m) when m divides a − b—that is, when a and b leave the same remainder modulo m.
Integers a and b are congruent modulo m when their difference is divisible by m.
A positive integer greater than 1 with no positive divisors except 1 and itself.
A way to treat integers as equivalent when they have the same remainder.
The gcd of a and b can be written ax + by for some integers x and y.
04 · A beautiful result
Suppose gcd(a, m) = 1. Bézout’s identity gives integers x and y with ax + my = 1. Reducing this equation modulo m removes the multiple my and leaves ax ≡ 1 (mod m).
Therefore x is a multiplicative inverse of a modulo m. This is the arithmetic mechanism behind solving linear congruences and an essential step in public-key cryptography.
Use the Euclidean algorithm to establish gcd(a, m) = 1.
Trace the remainders backward to obtain ax + my = 1.
Reduce modulo m: my becomes 0, so ax ≡ 1 (mod m).
Thus multiplying by x reverses multiplication by a in modular arithmetic.
05 · Why this subject matters
RSA encryption uses modular exponentiation and the difficulty of factoring a large product of primes. The theory does not rely on numbers being mysterious; it relies on a carefully chosen asymmetry between efficient operations and computationally difficult inverse problems.
Number theory also connects to error-correcting codes, pseudorandomness, Diophantine equations, and the distribution of primes.
Builds keys and reversible operations from modular arithmetic.
Congruence classes form groups, rings, and fields.
Finite arithmetic helps detect and correct transmission errors.
06 · Friendly assessment
The questions focus on the main insights, not obscure details. Each response receives an explanation immediately.
Where this idea leads
Turn modular arithmetic into secure communication.
Explore →Connected fieldStudy modular systems as algebraic structures.
Explore →Connected fieldUse finite fields to protect information.
Explore →Connected fieldCount number-theoretic patterns and configurations.
Explore →This is an invitation to continue, not a compressed substitute for a full university course.