Carmichael Function Calculator

λ(n) = exp(Z/nZ)*

CalculatorsFreeNo Signup
4.5(626 reviews)
All Tools

Loading tool...

About Carmichael Function Calculator

A Carmichael function calculator computing λ(n): the exponent of the multiplicative group (Z/nZ)*. λ(n) is the smallest positive k such that aᵏ≡1 (mod n) for ALL a coprime to n. Shows factorization and comparison with φ(n). Client-side.

Carmichael Function Calculator Features

  • λ(n) computation
  • Factorization
  • Compare φ(n)
  • Carmichael check
  • Table
Carmichael function λ(n): smallest k with aᵏ≡1 (mod n) for all gcd(a,n)=1. Always divides φ(n), equals φ(n) iff (Z/nZ)* is cyclic. λ(pᵏ)=φ(pᵏ) for odd p, λ(2)=1, λ(4)=2, λ(2ᵏ)=2ᵏ⁻². For n=p₁ᵉ¹·...·pₖᵉᵏ: λ(n)=lcm(λ(pᵢᵉⁱ)).

How to Use

Enter n:

  • λ(n): Carmichael function
  • φ(n): Euler's totient
  • Ratio: φ(n)/λ(n)

Formula

  • λ(1)=1, λ(2)=1, λ(4)=2
  • λ(pᵏ) = φ(pᵏ) = pᵏ⁻¹(p−1) for odd p
  • λ(2ᵏ) = 2ᵏ⁻² for k≥3
  • λ(n) = lcm(λ(pᵢᵉⁱ))

Carmichael Numbers

n is Carmichael if aⁿ≡a (mod n) for all a, but n is composite. Equivalently: λ(n)|(n−1). First: 561=3·11·17. Infinitely many exist (Alford-Granville-Pomerance, 1994).

Step-by-Step Instructions

  1. 1Enter n.
  2. 2Get λ(n).
  3. 3Compare φ(n).
  4. 4Check Carmichael.
  5. 5See factorization.

Carmichael Function Calculator — Frequently Asked Questions

How does λ(n) differ from φ(n)?+

φ(n) counts coprimes; λ(n) is the maximum order in (Z/nZ)*. They're equal when the group is cyclic (n=1,2,4,pᵏ,2pᵏ). Otherwise λ(n)<φ(n). Example: φ(8)=4 but λ(8)=2 because every odd number squared ≡1 (mod 8).

What are Carmichael numbers?+

Composite n where aⁿ⁻¹≡1 (mod n) for all gcd(a,n)=1. These fool Fermat's primality test. By Korselt's criterion: n is Carmichael iff n is squarefree and (p−1)|(n−1) for every prime p|n. First few: 561, 1105, 1729.

Why is λ(n) important for RSA?+

In RSA: ed≡1 (mod λ(n)) suffices (not mod φ(n)). Since λ(n)|φ(n), using λ gives a smaller private exponent d, making decryption faster. The original RSA paper used φ(n), but λ(n) is more precise.

Share this tool: