In number theory, a branch of mathematics, the Carmichael function λ(n) of a positive integer n is the smallest positive integer m such that holds for every integer a coprime to n. In algebraic terms, λ(n) is the exponent of the multiplicative group of integers modulo n. As this is a finite abelian group, there must exist an element whose order equals the exponent, λ(n).
Such an element is called a primitive λ-root modulo n. The Carmichael function is named after the American mathematician Robert Carmichael who defined it in 1910.
The order of the multiplicative group of integers modulo n is φ(n), where φ is Euler's totient function.
Since the order of an element of a finite group divides the order of the group, λ(n) divides φ(n).
The following table compares the first 36 values of λ(n) (sequence A002322 in the OEIS) and φ(n) (in bold if they are different; the ns such that they are different are listed in OEIS: A033949).
The Carmichael lambda function of a prime power can be expressed in terms of the Euler totient.
Any number that is not 1 or a prime power can be written uniquely as the product of distinct prime powers, in which case λ of the product is the least common multiple of the λ of the prime power factors.
Specifically, λ(n) is given by the recurrence Euler's totient for a prime power, that is, a number pr with p prime and r ≥ 1, is given by
Carmichael proved two theorems that, together, establish that if λ(n) is considered as defined by the recurrence of the previous section, then it satisfies the property stated in the introduction, namely that it is the smallest positive integer m such that
[2] This implies that the order of every element of the multiplicative group of integers modulo n divides λ(n).
-root modulo n.) Theorem 2 — For every positive integer n there exists a primitive λ-root modulo n. Moreover, if g is such a root, then there are
for all a relatively prime to n. The second statement of Theorem 2 does not imply that all primitive λ-roots modulo n are congruent to powers of a single root g.[5] For example, if n = 15, then λ(n) = 4 while
There are four primitive λ-roots modulo 15, namely 2, 7, 8, and 13 as
The other four elements of the multiplicative group modulo 15, namely 1, 4 (which satisfies
There are two primitive λ-roots modulo 9, namely 2 and 5, each of which is congruent to the fifth power of the other.
This is written as Suppose am ≡ 1 (mod n) for all numbers a coprime with n. Then λ(n) | m. Proof: If m = kλ(n) + r with 0 ≤ r < λ(n), then for all numbers a coprime with n. It follows that r = 0 since r < λ(n) and λ(n) is the minimal positive exponent for which the congruence holds for all a coprime with n. This follows from elementary group theory, because the exponent of any finite group must divide the order of the group.
λ(n) is the exponent of the multiplicative group of integers modulo n while φ(n) is the order of that group.
In particular, the two must be equal in the cases where the multiplicative group is cyclic due to the existence of a primitive root, which is the case for odd prime powers.
For all positive integers a and b it holds that This is an immediate consequence of the recurrence for the Carmichael function.
is the biggest exponent in the prime factorization
of n, then for all a (including those not coprime to n) and all r ≥ rmax, In particular, for square-free n ( rmax = 1), for all a we have For any n ≥ 16:[6][7] (called Erdős approximation in the following) with the constant and γ ≈ 0.57721, the Euler–Mascheroni constant.
The following table gives some overview over the first 226 – 1 = 67108863 values of the λ function, for both, the exact average and its Erdős-approximation.
Additionally given is some overview over the more easily accessible “logarithm over logarithm” values LoL(n) := ln λ(n)/ln n with There, the table entry in row number 26 at column indicates that 60.49% (≈ 40000000) of the integers 1 ≤ n ≤ 67108863 have λ(n) > n4/5 meaning that the majority of the λ values is exponential in the length l := log2(n) of the input n, namely For all numbers N and all but o(N)[8] positive integers n ≤ N (a "prevailing" majority): with the constant[7] For any sufficiently large number N and for any Δ ≥ (ln ln N)3, there are at most positive integers n ≤ N such that λ(n) ≤ ne−Δ.
[9] For any sequence n1 < n2 < n3 < ⋯ of positive integers, any constant 0 < c < 1/ln 2, and any sufficiently large i:[10][11] For a constant c and any sufficiently large positive A, there exists an integer n > A such that[11] Moreover, n is of the form for some square-free integer m < (ln A)c ln ln ln A.
[10] The set of values of the Carmichael function has counting function[12] where The Carmichael function is important in cryptography due to its use in the RSA encryption algorithm.
For n = p, a prime, Theorem 1 is equivalent to Fermat's little theorem: For prime powers pr, r > 1, if holds for some integer h, then raising both sides to the power p gives for some other integer
This establishes the theorem for n = 4 or any odd prime power.
[13] By the unique factorization theorem, any n > 1 can be written in a unique way as where p1 < p2 < ... < pk are primes and r1, r2, ..., rk are positive integers.
The results for prime powers establish that, for
, From this it follows that where, as given by the recurrence, From the Chinese remainder theorem one concludes that