The term "Carmichael function" has two definitions. One is the reduced totient function (also called the least universal exponent function), defined
as the smallest positive integer such that
for all integers
relatively
prime to the positive integer
. For
and an integer
relatively prime to
, its multiplicative
order (mod
)
divides
(Ribenboim 1989). The first few values of this function,
implemented as CarmichaelLambda[n],
are 1, 1, 2, 2, 4, 2, 6, 2, 6, 4, 10, ... (OEIS A002322).
It is given by the formula
|
(1)
|
where
is the prime factorization of
, with distinct primes
and positive
integer exponents
, so
are the primaries
of
.
The initial value is
.
For ,
it can be defined recursively as follows, where
is a prime number and
is a positive
integer:
|
(2)
|
Here
is the totient function. For positive
integers
,
some special values include
|
(3)
|
and
|
(4)
|
where
is a primorial (S. M. Ruiz, pers. comm.,
Jul. 5, 2009).
The second convention, denoted , takes the least
common multiple (LCM) of the totient function
values of the prime power factors of
,
|
(5)
|
with .
The values of
for the first few
are 1, 1, 2, 2, 4, 2, 6, 4, 6, 4, 10, 2, 12, ... (OEIS A011773).
This function has the special value
|
(6)
|
for
an odd prime and
a positive integer.