This site is supported by donations to The OEIS Foundation.

# Carmichael function

In the Carmichael function ${\displaystyle \scriptstyle m=\lambda (n)\,}$ is ${\displaystyle \scriptstyle m\,}$ the smallest number so that ${\displaystyle \scriptstyle b^{m}\equiv 1{\pmod {n}}\,}$ for every ${\displaystyle \scriptstyle b\,}$ that is coprime to ${\displaystyle \scriptstyle n\,}$. The namesake is Robert Daniel Carmichael (1879—1967).

## Calculation of the Carmichael function

{\displaystyle {\begin{aligned}\lambda (1)&=1\\\lambda (2)&=1\\\lambda (4)&=2\\\lambda (2^{k})&=2^{k-2}\quad \mathrm {f{\ddot {u}}r} \ k>2\\\lambda (p^{k})&=p^{k-1}\cdot (p-1)\quad \mathrm {f{\ddot {u}}r} \ p\geq 3\ \mathrm {prim} ,k>0\\\lambda (p_{1}^{k_{1}}p_{2}^{k_{2}}\cdot \cdot \cdot p_{s}^{k_{s}})&=\operatorname {lcm} \{\lambda (p_{1}^{k_{1}}),\lambda (p_{2}^{k_{2}}),...,\lambda (p_{s}^{k_{s}})\}\end{aligned}}}

${\displaystyle p_{i}}$ means distinct primes and ${\displaystyle k_{i}}$ means natural numbers.
The function is available in Mathematica as "CarmichaelLambda[n]".

## Carmichael function and Euler totient function

The Carmichael function ${\displaystyle \scriptstyle \lambda (n)}$ is a divisor of Euler's totient function ${\displaystyle \scriptstyle \varphi (n)}$ . For 1 and every prime number the Carmichael function is equal to the Euler's totient function

### Example of difference

• Euler's totient function:
${\displaystyle \varphi (105)=\varphi (3\cdot 5\cdot 7)=\varphi (3)\cdot \varphi (5)\cdot \varphi (7)=2\cdot 4\cdot 6=48}$
• Carmichael function:
${\displaystyle \lambda (105)=\lambda (3\cdot 5\cdot 7)=\operatorname {lcm} \{\lambda (3),\lambda (5)\lambda (7)\}=\operatorname {lcm} \{2,4,6\}=12}$

## Sequences

The Carmichael function (Cf. A002322):

{1, 1, 2, 2, 4, 2, 6, 2, 6, 4, 10, 2, 12, 6, 4, ...}
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 12, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}