🔢 Number Theory Calculator

Advanced number properties, prime testing, factorization, and number theory operations

Prime Number Testing

Prime Number Properties

A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. This calculator uses the Miller-Rabin primality test for large numbers.

Prime Factorization

Fundamental Theorem of Arithmetic

Every integer greater than 1 can be uniquely represented as a product of prime numbers (up to the order of factors).

Divisor Functions

Divisor Functions

τ(n) = number of divisors, σ(n) = sum of divisors. Perfect numbers have σ(n) = 2n.

Euler's Totient Function

φ(n) = n × ∏(1 - 1/p) for all prime factors p of n

Euler's Totient Function

φ(n) counts the positive integers up to n that are relatively prime to n. Important in number theory and cryptography.

Linear Congruences

ax ≡ b (mod m) has solutions iff gcd(a,m) | b

Linear Diophantine Equations

ax + by = c has integer solutions iff gcd(a,b) | c