Carmichael function#Carmichael's theorems

{{Short description|Function in mathematical number theory}}

In number theory, a branch of mathematics, the Carmichael function {{math | λ(n)}} of a positive integer {{mvar | n}} is the smallest positive integer {{mvar|m}} such that

:a^m \equiv 1 \pmod{n}

holds for every integer {{mvar | a}} coprime to {{mvar | n}}. In algebraic terms, {{math | λ(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, {{math | λ(n)}}. Such an element is called a primitive {{math | λ}}-root modulo {{mvar | n}}.

File:carmichaelLambda.svg

The Carmichael function is named after the American mathematician Robert Carmichael who defined it in 1910.

{{cite journal |first1=Robert Daniel |last1=Carmichael |year=1910 |title=Note on a new number theory function |journal=Bulletin of the American Mathematical Society |volume=16 |number=5 |pages=232–238 |doi=10.1090/S0002-9904-1910-01892-9|doi-access=free }}

It is also known as Carmichael's λ function, the reduced totient function, and the least universal exponent function.

The order of the multiplicative group of integers modulo {{mvar | n}} is {{math | φ(n)}}, where {{mvar | φ}} is Euler's totient function. Since the order of an element of a finite group divides the order of the group, {{math | λ(n)}} divides {{math | φ(n)}}. The following table compares the first 36 values of {{math | λ(n)}} {{OEIS|id=A002322}} and {{math | φ(n)}} (in bold if they are different; the values of{{mvar | n}} such that they are different are listed in {{oeis|A033949}}).

class="wikitable" style="text-align: center;"
scope="col" | {{mvar | n}}

! scope="col" | 1

! scope="col" | 2

! scope="col" | 3

! scope="col" | 4

! scope="col" | 5

! scope="col" | 6

! scope="col" | 7

! scope="col" | 8

! scope="col" | 9

! scope="col" | 10

! scope="col" | 11

! scope="col" | 12

! scope="col" | 13

! scope="col" | 14

! scope="col" | 15

! scope="col" | 16

! scope="col" | 17

! scope="col" | 18

! scope="col" | 19

! scope="col" | 20

! scope="col" | 21

! scope="col" | 22

! scope="col" | 23

! scope="col" | 24

! scope="col" | 25

! scope="col" | 26

! scope="col" | 27

! scope="col" | 28

! scope="col" | 29

! scope="col" | 30

! scope="col" | 31

! scope="col" | 32

! scope="col" | 33

! scope="col" | 34

! scope="col" | 35

! scope="col" | 36

scope="row" | {{math | λ(n)}}

| 1 || 1 || 2 || 2 || 4 || 2 || 6 || 2 || 6 || 4 || 10 || 2 || 12 || 6 || 4 || 4 || 16 || 6 || 18 || 4 || 6 || 10 || 22 || 2 || 20 || 12 || 18 || 6 || 28 || 4 || 30 || 8 || 10 || 16 || 12 || 6

scope="row" | {{math | φ(n)}}

| 1 || 1 || 2 || 2 || 4 || 2 || 6 || 4 || 6 || 4 || 10 || 4 || 12 || 6 || 8 || 8 || 16 || 6 || 18 || 8 || 12 || 10 || 22 || 8 || 20 || 12 || 18 || 12 || 28 || 8 || 30 || 16 || 20 || 16 || 24 || 12

Numerical examples

  • {{math | n {{=}} 5}}. The set of numbers less than and coprime to 5 is {{math | {1,2,3,4}}}. Hence Euler's totient function has value {{math | φ(5) {{=}} 4}} and the value of Carmichael's function, {{math | λ(5)}}, must be a divisor of 4. The divisor 1 does not satisfy the definition of Carmichael's function since a^1 \not\equiv 1\pmod{5} except for a\equiv1\pmod{5}. Neither does 2 since 2^2 \equiv 3^2 \equiv 4 \not\equiv 1\pmod{5}. Hence {{math | λ(5) {{=}} 4}}. Indeed, 1^4\equiv 2^4\equiv 3^4\equiv 4^4\equiv1\pmod{5}. Both 2 and 3 are primitive {{mvar | λ}}-roots modulo 5 and also primitive roots modulo 5.
  • {{math | n {{=}} 8}}. The set of numbers less than and coprime to 8 is {{math | {1,3,5,7} }}. Hence {{math | φ(8) {{=}} 4}} and {{math | λ(8)}} must be a divisor of 4. In fact {{math | λ(8) {{=}} 2}} since 1^2\equiv 3^2\equiv 5^2\equiv 7^2\equiv1\pmod{8}. The primitive {{mvar | λ}}-roots modulo 8 are 3, 5, and 7. There are no primitive roots modulo 8.

Recurrence for {{math | ''λ''(''n'')}}

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 {{mvar | λ}} of the product is the least common multiple of the {{mvar | λ}} of the prime power factors. Specifically, {{math | λ(n)}} is given by the recurrence

:\lambda(n) = \begin{cases}

\varphi(n) & \text{if }n\text{ is 1, 2, 4, or an odd prime power,}\\

\tfrac12\varphi(n) & \text{if }n=2^r,\ r\ge3,\\

\operatorname{lcm}\Bigl(\lambda(n_1),\lambda(n_2),\ldots,\lambda(n_k)\Bigr) & \text{if }n=n_1n_2\ldots n_k\text{ where }n_1,n_2,\ldots,n_k\text{ are powers of distinct primes.}

\end{cases}

Euler's totient for a prime power, that is, a number {{math | pr}} with {{math | p}} prime and {{math | r ≥ 1}}, is given by

:\varphi(p^r) {{=}} p^{r-1}(p-1).

Carmichael's theorems

{{anchor|Carmichael's theorem}}

Carmichael proved two theorems that, together, establish that if {{math | λ(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 {{mvar | m}} such that a^m\equiv 1\pmod{n} for all {{mvar | a}} relatively prime to {{mvar | n}}.

{{Math theorem |name=Theorem 1|math_statement=If {{mvar | a}} is relatively prime to {{mvar | n}} then a^{\lambda(n)}\equiv 1\pmod{n}.Carmichael (1914) p.40}}

This implies that the order of every element of the multiplicative group of integers modulo {{mvar | n}} divides {{math | λ(n)}}. Carmichael calls an element {{mvar | a}} for which a^{\lambda(n)} is the least power of {{mvar | a}} congruent to 1 (mod {{mvar | n}}) a primitive λ-root modulo n.Carmichael (1914) p.54 (This is not to be confused with a primitive root modulo n, which Carmichael sometimes refers to as a primitive \varphi-root modulo {{mvar | n}}.)

{{Math theorem |name=Theorem 2|math_statement=For every positive integer {{mvar | n}} there exists a primitive {{mvar | λ}}-root modulo {{mvar | n}}. Moreover, if {{mvar | g}} is such a root, then there are \varphi(\lambda(n)) primitive {{mvar | λ}}-roots that are congruent to powers of {{mvar | g}}.Carmichael (1914) p.55}}

If {{mvar | g}} is one of the primitive {{mvar | λ}}-roots guaranteed by the theorem, then g^m\equiv1\pmod{n} has no positive integer solutions {{mvar | m}} less than {{math | λ(n)}}, showing that there is no positive {{math | m < λ(n)}} such that a^m\equiv 1\pmod{n} for all {{mvar | a}} relatively prime to {{mvar | n}}.

The second statement of Theorem 2 does not imply that all primitive {{mvar | λ}}-roots modulo {{mvar | n}} are congruent to powers of a single root {{mvar | g}}.Carmichael (1914) p.56 For example, if {{math | n {{=}} 15}}, then {{math | λ(n) {{=}} 4}} while \varphi(n)=8 and \varphi(\lambda(n))=2. There are four primitive {{mvar | λ}}-roots modulo 15, namely 2, 7, 8, and 13 as 1\equiv2^4\equiv8^4\equiv7^4\equiv13^4. The roots 2 and 8 are congruent to powers of each other and the roots 7 and 13 are congruent to powers of each other, but neither 7 nor 13 is congruent to a power of 2 or 8 and vice versa. The other four elements of the multiplicative group modulo 15, namely 1, 4 (which satisfies 4\equiv2^2\equiv8^2\equiv7^2\equiv13^2), 11, and 14, are not primitive {{mvar | λ}}-roots modulo 15.

For a contrasting example, if {{math | n {{=}} 9}}, then \lambda(n)=\varphi(n)=6 and \varphi(\lambda(n))=2. There are two primitive {{mvar | λ}}-roots modulo 9, namely 2 and 5, each of which is congruent to the fifth power of the other. They are also both primitive \varphi-roots modulo 9.

Properties of the Carmichael function

In this section, an integer n is divisible by a nonzero integer m if there exists an integer k such that n = km. This is written as

:m \mid n.

=A consequence of minimality of {{math | ''λ''(''n'')}}=

Suppose {{math | am ≡ 1 (mod n)}} for all numbers {{mvar | a}} coprime with {{mvar | n}}. Then {{math | λ(n) {{!}} m}}.

Proof: If {{math | m {{=}} (n) + r}} with {{math | 0 ≤ r < λ(n)}}, then

:a^r = 1^k \cdot a^r \equiv \left(a^{\lambda(n)}\right)^k\cdot a^r = a^{k\lambda(n)+r} = a^m \equiv 1\pmod{n}

for all numbers {{mvar | a}} coprime with {{mvar | n}}. It follows that {{math | 1=r = 0}} since {{math | r < λ(n)}} and {{math | λ(n)}} is the minimal positive exponent for which the congruence holds for all {{mvar | a}} coprime with {{mvar | n}}.

= {{math | ''λ''(''n'')}} divides {{math | ''φ''(''n'')}} =

This follows from elementary group theory, because the exponent of any finite group must divide the order of the group. {{math | λ(n)}} is the exponent of the multiplicative group of integers modulo {{mvar | n}} while {{math | φ(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.

We can thus view Carmichael's theorem as a sharpening of Euler's theorem.

=Divisibility=

: a\,|\,b \Rightarrow \lambda(a)\,|\,\lambda(b)

Proof.

By definition, for any integer k with \gcd(k,b) = 1 (and thus also \gcd(k,a) = 1), we have that b \,|\, (k^{\lambda(b)} - 1) , and therefore a \,|\, (k^{\lambda(b)} - 1). This establishes that k^{\lambda(b)}\equiv1\pmod{a} for all {{mvar | k}} relatively prime to {{mvar | a}}. By the consequence of minimality proved above, we have \lambda(a)\,|\,\lambda(b) .

=Composition=

For all positive integers {{mvar | a}} and {{mvar | b}} it holds that

:\lambda(\mathrm{lcm}(a,b)) = \mathrm{lcm}(\lambda(a), \lambda(b)).

This is an immediate consequence of the recurrence for the Carmichael function.

=Exponential cycle length=

If r_{\mathrm{max}}=\max_i\{r_i\} is the biggest exponent in the prime factorization n= p_1^{r_1}p_2^{r_2} \cdots p_{k}^{r_k} of {{mvar | n}}, then for all {{mvar | a}} (including those not coprime to {{mvar | n}}) and all {{math | rrmax}},

:a^r \equiv a^{\lambda(n)+r} \pmod n.

In particular, for square-free {{mvar | n}} ({{math | rmax {{=}} 1}}), for all {{mvar | a}} we have

:a \equiv a^{\lambda(n)+1} \pmod n.

=Average value=

For any {{math | n ≥ 16}}:Theorem 3 in Erdős (1991)Sándor & Crstici (2004) p.194

:\frac{1}{n} \sum_{i \leq n} \lambda (i) = \frac{n}{\ln n} e^{B (1+o(1)) \ln\ln n / (\ln\ln\ln n) }

(called Erdős approximation in the following) with the constant

:B := e^{-\gamma} \prod_{p\in\mathbb P} \left({1 - \frac{1}{(p-1)^2(p+1)}}\right) \approx 0.34537

and {{math | γ ≈ 0.57721}}, the Euler–Mascheroni constant.

The following table gives some overview over the first {{math | 1=226 – 1 = {{val|fmt=gaps|67108863}}}} values of the {{mvar | λ}} function, for both, the exact average and its Erdős-approximation.

Additionally given is some overview over the more easily accessible {{nowrap|“logarithm over logarithm” values}} {{math | 1=LoL(n) := {{sfrac|ln λ(n)|ln n}}}} with

  • {{math | LoL(n) > {{sfrac|4|5}} ⇔ λ(n) > n{{sfrac|4|5}}}}.

There, the table entry in row number 26 at column

  • {{math | % LoL > {{sfrac|4|5}}}} {{pad|1em}} → 60.49

indicates that 60.49% (≈ {{val|fmt=gaps|40000000}}) of the integers {{math | 1 ≤ n ≤ {{val|fmt=gaps|67108863}}}} have {{math | λ(n) > n{{sfrac|4|5}}}} meaning that the majority of the {{mvar | λ}} values is exponential in the length {{math | l :{{=}} log2(n)}} of the input {{mvar | n}}, namely

:\left(2^\frac45\right)^l = 2^\frac{4l}{5} = \left(2^l\right)^\frac45 = n^\frac45.

:

class="wikitable" style="text-align:right"
style="vertical-align:top"

! {{mvar | ν}}

{{math | 1=n = 2ν – 1}}sum
\sum_{i\le n} \lambda(i)
average
\tfrac1n \sum_{i\le n} \lambda(i)
Erdős averageErdős /
exact average
{{math | LoL}} average% {{math | LoL}} > {{sfrac|4|5}}% {{math | LoL}} > {{sfrac|7|8}}
5312708.70967768.6437.88130.67824441.9435.48
66396415.30158761.4144.01360.69989138.1030.16
7127357428.14173286.6053.07740.71729138.5827.56
82551299450.956863138.1902.71190.73033138.8223.53
95114803293.996086233.1492.48040.74049840.9025.05
101023178816174.795699406.1452.32350.74848241.4526.98
112047662952323.865169722.5262.23090.75488642.8427.70
1240952490948608.2901101304.8102.14500.76102743.7428.11
13819193827641145.4967652383.2632.08060.76657144.3328.60
1416383355045862167.1602274392.1292.02670.77169546.1029.52
15327671347368244111.9670408153.0541.98280.77643747.2129.15
16655355137587967839.45671815225.43{{0}}1.94220.78106449.1328.17
17131071196441359214987.40066{{0}}28576.97{{0}}1.90670.78540150.4329.55
18262143752921820828721.79768{{0}}53869.76{{0}}1.87560.78956151.1730.67
195242872893564434255190.46694{{0}}101930.9{{0|00}}1.84690.79353652.6231.45
201048575111393101150106232.8409{{0|00}}193507.1{{0|00}}1.82150.79735153.7431.83
212097151429685077652204889.9090{{0|00}}368427.6{{0|00}}1.79820.80101854.9732.18
2241943031660388309120395867.5158{{0|00}}703289.4{{0|00}}1.77660.80454356.2433.65
2383886076425917227352766029.1187{{0|00}}1345633{{0|.000}}1.75660.80793657.1934.32
2416777215249068726559901484565.386{{0|000}}2580070{{0|.000}}1.73790.81120458.4934.43
2533554431966665958654302880889.140{{0|000}}4956372{{0|.000}}1.72040.81435159.5235.76
26671088633756190480865765597160.066{{0|000}}9537863{{0|.000}}1.70410.81738460.4936.73

=Prevailing interval=

For all numbers {{mvar | N}} and all but {{math | o(N)}}Theorem 2 in Erdős (1991) 3. Normal order. (p.365) positive integers {{math | nN}} (a "prevailing" majority):

:\lambda(n) = \frac{n} {(\ln n)^{\ln\ln\ln n + A + o(1)}}

with the constant

:A := -1 + \sum_{p\in\mathbb P} \frac{\ln p}{(p-1)^2} \approx 0.2269688

=Lower bounds=

For any sufficiently large number {{mvar | N}} and for any {{math | Δ ≥ (ln ln N)3}}, there are at most

:N\exp\left(-0.69(\Delta\ln\Delta)^\frac13\right)

positive integers {{math | n ≤ N}} such that {{math | λ(n) ≤ ne−Δ}}.Theorem 5 in Friedlander (2001)

=Minimal order=

For any sequence {{math | n1 < n2 < n3 < ⋯}} of positive integers, any constant {{math | 0 < c < {{sfrac|1|ln 2}}}}, and any sufficiently large {{mvar | i}}:Theorem 1 in Erdős (1991)Sándor & Crstici (2004) p.193

:\lambda(n_i) > \left(\ln n_i\right)^{c\ln\ln\ln n_i}.

=Small values=

For a constant {{mvar | c}} and any sufficiently large positive {{mvar | A}}, there exists an integer {{math | n > A}} such that

:\lambda(n)<\left(\ln A\right)^{c\ln\ln\ln A}.

Moreover, {{mvar | n}} is of the form

:n=\mathop{\prod_{q \in \mathbb P}}_{(q-1)|m}q

for some square-free integer {{math | m < (ln A)c ln ln ln A}}.

=Image of the function=

The set of values of the Carmichael function has counting function{{cite journal | arxiv=1408.6506 | title=The image of Carmichael's λ-function | first1=Kevin | last1=Ford | first2=Florian | last2=Luca | first3=Carl | last3=Pomerance | date=27 August 2014 | doi=10.2140/ant.2014.8.2009 | volume=8 | issue=8 | journal=Algebra & Number Theory | pages=2009–2026| s2cid=50397623 }}

:\frac{x}{(\ln x)^{\eta+o(1)}} ,

where

:\eta=1-\frac{1+\ln\ln2}{\ln2} \approx 0.08607

Use in cryptography

The Carmichael function is important in cryptography due to its use in the RSA encryption algorithm.

Proof of Theorem 1

For {{math | n {{=}} p}}, a prime, Theorem 1 is equivalent to Fermat's little theorem:

:a^{p-1}\equiv1\pmod{p}\qquad\text{for all }a\text{ coprime to }p.

For prime powers {{math | pr}}, {{math | r > 1}}, if

:a^{p^{r-1}(p-1)}=1+hp^r

holds for some integer {{mvar | h}}, then raising both sides to the power {{mvar | p}} gives

:a^{p^r(p-1)}=1+h'p^{r+1}

for some other integer h'. By induction it follows that a^{\varphi(p^r)}\equiv1\pmod{p^r} for all {{mvar | a}} relatively prime to {{mvar | p}} and hence to {{math | pr}}. This establishes the theorem for {{math | n {{=}} 4}} or any odd prime power.

=Sharpening the result for higher powers of two=

For {{mvar | a}} coprime to (powers of) 2 we have {{math | a {{=}} 1 + 2h2}} for some integer {{math | h2}}. Then,

:a^2 = 1+4h_2(h_2+1) = 1+8\binom{h_2+1}{2}=:1+8h_3,

where h_3 is an integer. With {{math | 1=r = 3}}, this is written

:a^{2^{r-2}} = 1+2^r h_r.

Squaring both sides gives

:a^{2^{r-1}}=\left(1+2^r h_r\right)^2=1+2^{r+1}\left(h_r+2^{r-1}h_r^2\right)=:1+2^{r+1}h_{r+1},

where h_{r+1} is an integer. It follows by induction that

:a^{2^{r-2}}=a^{\frac{1}{2}\varphi(2^r)}\equiv 1\pmod{2^r}

for all r\ge3 and all {{mvar | a}} coprime to 2^r.Carmichael (1914) pp.38–39

=Integers with multiple prime factors=

By the unique factorization theorem, any {{math | n > 1}} can be written in a unique way as

: n= p_1^{r_1}p_2^{r_2} \cdots p_{k}^{r_k}

where {{math | p1 < p2 < ... < pk}} are primes and {{math | r1, r2, ..., rk}} are positive integers. The results for prime powers establish that, for 1\le j\le k,

:a^{\lambda\left(p_j^{r_j}\right)}\equiv1 \pmod{p_j^{r_j}}\qquad\text{for all }a\text{ coprime to }n\text{ and hence to }p_i^{r_i}.

From this it follows that

:a^{\lambda(n)}\equiv1 \pmod{p_j^{r_j}}\qquad\text{for all }a\text{ coprime to }n,

where, as given by the recurrence,

:\lambda(n) = \operatorname{lcm}\Bigl(\lambda\left(p_1^{r_1}\right),\lambda\left(p_2^{r_2}\right),\ldots,\lambda\left(p_k^{r_k}\right)\Bigr).

From the Chinese remainder theorem one concludes that

:a^{\lambda(n)}\equiv1 \pmod{n}\qquad\text{for all }a\text{ coprime to }n.

See also

Notes

References

  • {{cite journal |first1=Paul |last1= Erdős |author1-link=Paul Erdős |first2=Carl |last2=Pomerance |author2-link=Carl Pomerance |first3=Eric |last3=Schmutz |year=1991 |title=Carmichael's lambda function |journal=Acta Arithmetica |volume=58 |issue= 4 |pages=363–385 |mr=1121092 | zbl=0734.11047 | issn=0065-1036 |doi=10.4064/aa-58-4-363-385|doi-access=free }}
  • {{cite journal |first1=John B. |last1=Friedlander |author1-link=John Friedlander |first2=Carl |last2=Pomerance |first3=Igor E. |last3=Shparlinski |year=2001 |title=Period of the power generator and small values of the Carmichael function |journal=Mathematics of Computation |volume=70 |number=236 |pages=1591–1605, 1803–1806 |mr=1836921 | zbl=1029.11043 | issn=0025-5718 |doi=10.1090/s0025-5718-00-01282-5|doi-access=free }}
  • {{cite book | last1=Sándor | first1=Jozsef | last2=Crstici | first2=Borislav | title=Handbook of number theory II | location=Dordrecht | publisher=Kluwer Academic | year=2004 | isbn=978-1-4020-2546-4 | pages=32–36, 193–195 | zbl=1079.11001}}
  • {{Gutenberg|no=13693|name=The Theory of Numbers|last=Carmichael|first=Robert D.|origyear=1914}}

{{Totient}}

Category:Modular arithmetic

Category:Functions and mappings