Euler's Totient & Number-Theoretic Functions
For a positive integer n, compute its multiplicative number-theoretic functions from the prime factorization: φ(n) (Euler's totient — how many 1 ≤ k ≤ n are coprime to n), λ(n) (Carmichael's function — the exponent of the multiplicative group mod n), τ(n) (number of divisors), σ(n) (sum of divisors), the distinct prime factors, and the full prime factorization. Also tells you whether n is prime. All arithmetic uses exact big integers. Runs locally in your browser.
Input
Result
φ(n) = n · ∏(1 − 1/p) over the distinct primes p dividing n; equivalently ∏ pᵏ⁻¹·(p−1) over the prime-power factors pᵏ. λ(n) (Carmichael) is the lcm of λ(pᵏ) over the prime powers, where λ(2)=1, λ(4)=2, λ(2ᵏ)=2ᵏ⁻² for k ≥ 3, and λ(pᵏ)=pᵏ⁻¹·(p−1) for odd primes. τ(n) = ∏(k+1) (divisor count) and σ(n) = ∏(pᵏ⁺¹−1)/(p−1) (divisor sum). n is prime iff its only prime factor is itself. Factorization uses trial division, so it is fast for moderate n but can be slow for large semiprimes. Pairs with the Prime Factorization, Extended Euclidean, and Modular Arithmetic tools. Everything runs locally — nothing leaves your browser.