Leandro Junes

Carmichael Function

Compute the exponent of the multiplicative group modulo n.

Inputs

A positive integer, arbitrarily large.

Factorization difficulty depends on the size of the factors, not just the size of the input. The calculator may return a partial factorization for difficult inputs. Computation runs locally in your browser.

Try

Result

—

Prime factorization

—

How it works

λ(n) is the smallest positive integer m such that a^m ≡ 1 (mod n) for every a coprime to n. It is the exponent of the group (ℤ/nℤ)^×, and it always divides φ(n) — the two are not the same function in general.

For odd prime powers λ(p^a) = φ(p^a); for powers of 2,

λ(2) = 1, λ(4) = 2, λ(2^a) = 2^(a−2) for a ≥ 3.

For n = p₁^a₁ ⋯ p_r^a_r, the prime-power values are combined with the least common multiple:

λ(n) = lcm(λ(p_1^a_1), …, λ(p_r^a_r)).

λ(1) = 1.