Number theory is the study of integers and their properties. Despite dealing with the simplest mathematical objects, it contains some of the deepest unsolved problems in mathematics. The Riemann hypothesis, Goldbach’s conjecture, and the twin prime conjecture have resisted proof for centuries. At the same time, number theory has remarkably practical applications in cryptography, coding theory, and computer science.



Prime numbers are the atoms of arithmetic. Every integer greater than 1 factors uniquely into primes (the Fundamental Theorem of Arithmetic). The prime number theorem tells us that the number of primes below x is approximately x/ln(x), meaning primes become less frequent but never run out. Our prime number checker tests primality, finds prime factorizations, and computes Euler’s totient function.



The greatest common divisor (GCD) of two numbers is the largest integer that divides both. Euclid’s algorithm finds the GCD efficiently by repeatedly taking remainders: gcd(a, b) = gcd(b, a mod b). The algorithm terminates in at most 5 times the number of digits in the smaller number. The least common multiple (LCM) is related by LCM(a, b) = ab / GCD(a, b). Our GCD and LCM calculator handles multiple numbers at once.



Modular arithmetic works on a clock-like system where numbers wrap around after reaching the modulus. In mod 12 arithmetic, 7 + 8 = 3 (because 15 mod 12 = 3). This simple idea powers modern cryptography. RSA encryption, which secures most internet transactions, relies on modular exponentiation: computing a^b mod m efficiently. The Chinese Remainder Theorem connects systems of simultaneous congruences and has applications in parallel computing and secret sharing.



Euler’s totient function phi(n) counts the integers from 1 to n that are relatively prime to n. For a prime p, phi(p) = p - 1. For a product of distinct primes, phi(pq) = (p-1)(q-1). Euler’s theorem states that a^phi(n) is congruent to 1 mod n when a and n are coprime. This generalizes Fermat’s little theorem (a^(p-1) is congruent to 1 mod p) and underpins RSA encryption.



The factorial and modulo calculator computes large factorials and reduces them modulo m, which is useful in combinatorial probability and competitive programming. Wilson’s theorem states that (p-1)! is congruent to -1 mod p if and only if p is prime, providing another (though impractical) primality test.



Combinatorics overlaps with number theory when counting arrangements. The permutation and combination calculator computes nPr and nCr, essential for probability calculations. The binomial coefficients that appear in these formulas also connect to Pascal’s triangle, the binomial theorem, and generating functions.



To explore further, try factoring large numbers, finding GCDs of unexpected pairs, and testing primality of numbers near powers of 2. The patterns you discover will deepen your appreciation for the structure hidden within the integers.