This site is supported by donations to The OEIS Foundation.
Euler's totient function
φ (n) |
n |
n |
n |
n |
-
φ (n) :=
n∑ i = 1
(n, i ) = 1n∑ i = 1
(n, i ) |
n |
i |
[·] |
A000010 Euler’s totient function
φ (n), n ≥ 1, |
n |
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, 36, 18, 24, 16, 40, 12, 42, 20, 24, 22, 46, 16, 42, 20, 32, 24, 52, 18, 40, 24, 36, 28, ...}
n, n ≥ 3, |
k |
n − k |
|
n |
Also called Euler’s
φ |
π (n) |
φ |
Contents
- 1 Totatives and cototatives
- 2 Properties
- 3 Formulae
- 4 Generating function
- 5 Harmonic series of totients
- 6 Related functions
- 6.1 Iterated Euler totient function
- 6.2 Iterated Euler cototient function
- 6.3 Totient summatory function
- 6.4 Cototient summatory function
- 6.5 Half difference of Dedekind psi function and Euler’s totient function
- 6.6 Product of the Dedekind psi function with Euler’s totient function
- 6.7 Quotient of the Dedekind psi function by Euler’s totient function
- 7 Sequences
- 8 See also
- 9 Notes
Totatives and cototatives
- Main article page: Totatives and cototatives
n |
n |
n |
n |
n |
n |
n |
-
{1 ≤ i ≤ n | (n, i ) = 1},
n |
-
{1 ≤ i ≤ n | (n, i ) > 1},
(n, i ) |
n |
i |
n |
n |
n |
-
φ (n) := | {1 ≤ i ≤ n | (n, i ) = 1} |,
n |
-
x̅φ (n) := | {1 ≤ i ≤ n | (n, i ) > 1} |.
Properties
Euler’s totient function is a multiplicative arithmetic function, e.g.
-
φ (m n) = φ (m) ⋅ φ (n), (m, n) = 1.
n ≥ 3 |
k |
n − k |
|
n |
Theorem.Note the requirement
Euler’s totient function is multiplicative. Given coprime integersand
m , the equation
n holds.
φ (m n) = φ (m) φ (n)
Proof. Remember that Euler’s totient function counts how many members the reduced residue system modulo a given number has. Designate the reduced residue system moduloby
m , and the one for
r1, r2, ..., rφ (m) by
n . If
s1, s2, ..., sφ (n) is in a residue system modulo
x , it follows that
m n and so
gcd (x, m) = gcd (x, n) = 1 and
x ≡ rh (mod m) for some
x ≡ si (mod n) and
h . Per the Chinese remainder theorem, each pair of
i and
h determines just one possible
i modulo
x . There are
m n possible pairs of
φ (m) φ (n) and
h . This means that the reduced residue system modulo
i has
m n terms and therefore
φ (m) φ (n) as specified by the theorem.[6] □
φ (m n) = φ (m) φ (n)
gcd (m, n) = 1 |
Formulae
Euler’s totient function
Since 1 has no prime factors (it is the empty product of prime factors), it is then coprime to any integer, including itself, i.e.(n, 1) = 1, n ≥ 1, |
-
φ (1) = 1.
p |
-
φ ( p) = p − 1.
p α |
-
φ ( p α ) = p α − p α − 1 = p α − 1 ( p − 1) = p α 1 −
= p α1 p
.p − 1 p
Euler’s totient function being multiplicative, we get
-
φ (n) = φ ω (n)∏ i = 1ω (n)∏ i = 1
=1 pi n ω (n)∏ i = 1
= n1 pi ω (n)∏ i = 1
,pi − 1 pi
pi |
n |
ω (n) |
n |
n = 1 |
φ (n), n ≥ 1, |
(n, φ (n)) |
-
as the only case whereφ (1) = 1
; for all higherφ (n) = n
,n
(with equality if and only if n is prime).φ (n) ≤ n − 1 -
andφ (2) = 1
as the only two cases whereφ (6) = 2
; for all other prime or compositeφ (n) < √ n
,n
.φ (n) ≥ √ n -
as the only case of a compositeφ (4) = 2
such thatn
. For all compositeφ (n) = √ n
we can sharpen the previously stated inequality ton > 6
.φ (n) > √ n
Euler’s cototient function
-
x̅φ (n) := n − φ (n),
-
x̅φ (n) :=
n∑ i = 1
(n, i ) ≠ 1n∑ i = 1
(n, i ) |
n |
i |
[·] |
Euler’s totient function and Dedekind psi function
Compare Euler’s totient function
-
φ (n) := n ⋅ ∏ p∣n
p prime
= n ⋅1 p ω (n)∏ i = 1
,1 pi
with Dedekind psi function, which is defined by the formula
-
ψ (n) := n ⋅ ∏ p∣n
p prime
= n ⋅1 p ω (n)∏ i = 1
.1 pi
The totient function is multiplicative,[8] and accordingly A000010 has keyword:mult.
Generating function
Dirichlet generating function
The Dirichlet generating function ofφ (n) |
-
D{φ (n)}(s) := ∞∑ n = 1
=φ (n) n s
=ζ (s − 1) ζ (s)
⋅ D{ψ (n)}(s) .ζ (2 s) (ζ (s)) 2
Harmonic series of totients
The harmonic series of totients (sum of reciprocals of the totients) diverges
- n
∑ i = 1
− A (log n + B ) ∼ O1 φ (i )
∼ Olog n n
,1 π (n)
π (n) |
A |
-
A = ∞∑ i = 1q (i ) φ (i )
=1 i
= 1.9435964368207592…ζ (2) ζ (3) ζ (6)
q (n) = | μ (n) | |
B |
− A B = − 0.0605742294… |
-
B = γ − ∞∑ i = 1q (i ) φ (i )
= 0.57721566… − 0.60838171786… = − 0.03116605…log i i
γ |
Related functions
Iterated Euler totient function
The totient function can be iterated until it reaches 1; A003434 counts how many iterations it takes. We can add up the iterations of the totient function; numbers that add up to themselves are called perfect totient numbers (see A082897).
Iterated Euler cototient function
(...)
Totient summatory function
The totient summatory function (partial sums of Euler’s totient function) is
-
Φ (n) := n∑ i = 1
φ (n) |
n ≥ 2 |
Cototient summatory function
The cototient summatory function (partial sums of Euler’s cototient function) is
-
X̅Φ (n) := n∑ i = 1
x̅φ (n) |
Half difference of Dedekind psi function and Euler’s totient function
-
=ψ (n) − φ (n) 2
⋅ {n 2 ∏ p∣n
p prime
−1 p ∏ p∣n
p prime
}.1 p
|
A-number | |||||
---|---|---|---|---|---|---|
|
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, ...}
|
A000027 | ||||
|
{1, 3, 4, 6, 6, 12, 8, 12, 12, 18, 12, 24, 14, 24, 24, 24, 18, 36, 20, 36, 32, 36, 24, 48, 30, 42, 36, 48, 30, 72, 32, 48, 48, 54, 48, 72, ...}
|
A001615 | ||||
|
{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, ...}
|
A000010 | ||||
|
{0, 2, 2, 4, 2, 10, 2, 8, 6, 14, 2, 20, 2, 18, 16, 16, 2, 30, 2, 28, 20, 26, 2, 40, 10, 30, 18, 36, 2, 64, 2, 32, 28, 38, 24, 60, ...}
|
A292786 | ||||
|
{0, 1, 1, 2, 1, 5, 1, 4, 3, 7, 1, 10, 1, 9, 8, 8, 1, 15, 1, 14, 10, 13, 1, 20, 5, 15, 9, 18, 1, 32, 1, 16, 14, 19, 12, 30, ...}
|
A?????? | ||||
|
{0, 1, 1, 2, 1, 5, 1, 4, 3, 7, 1, 10, 1, 9, 8, 8, 1, 15, 1, 14, 10, 13, 1, 20, 5, 15, 9, 18, 1, 31, 1, 16, 14, 19, 12, 30, ...}
|
A069359 | ||||
|
{0, 1, 1, 4, 1, 5, 1, 12, 6, 7, 1, 16, 1, 9, 8, 32, 1, 21, 1, 24, 10, 13, 1, 44, 10, 15, 27, 32, 1, 31, 1, 80, 14, 19, 12, 60, ...}
|
A003415 |
|
n |
|
n = 1 |
n |
n |
p k |
p k − 1 |
Product of the Dedekind psi function with Euler’s totient function
The product of the Dedekind psi function with Euler’s totient function gives-
ψ (n) ⋅ φ (n) = n 2 ⋅ ∏ p∣n
p prime
1 −1 p
= n 2 ⋅1 p ∏ p∣n
p prime
=1 p 2 n 2 ⋅ ∏ p∣n
p prime
=p 2 − 1 p 2
2 ⋅n rad (n) ∏ p∣n
p prime
rad (n) |
n |
p 2 − 1 |
p |
ψ (n) ⋅ φ (n) |
24 ω (n) |
n |
24 ω (n) − 1 |
n |
ω (n) |
n |
Quotient of the Dedekind psi function by Euler’s totient function
The quotient of the Dedekind psi function by Euler’s totient function gives
-
=ψ (n) φ (n) ∏ p∣n
p prime
=1 + 1 p 1 − 1 p ∏ p∣n
p prime
.p + 1 p − 1
Sequences
A092249 The totient summatory function (partial sums of Euler’s totient function) (see A002088 forn ≥ 0 |
n ≥ 2 |
- {1, 2, 4, 6, 10, 12, 18, 22, 28, 32, 42, 46, 58, 64, 72, 80, 96, 102, 120, 128, 140, 150, 172, 180, 200, 212, 230, 242, 270, 278, 308, 324, 344, 360, 384, 396, 432, 450, 474, 490, 530, 542, 584, 604, ...}
n |
φ (m) |
m ≥ 1 |
- {1, 2, 4, 6, 8, 10, 12, 16, 18, 20, 22, 24, 28, 30, 32, 36, 40, 42, 44, 46, 48, 52, 54, 56, 58, 60, 64, 66, 70, 72, 78, 80, 82, 84, 88, 92, 96, 100, 102, 104, 106, 108, 110, 112, 116, 120, 126, 128, 130, ...}
A007617 The nontotients, i.e. values not in range of Euler’s totient function. (Note that all odd values greater than 1 are nontotients.)
- {3, 5, 7, 9, 11, 13, 14, 15, 17, 19, 21, 23, 25, 26, 27, 29, 31, 33, 34, 35, 37, 38, 39, 41, 43, 45, 47, 49, 50, 51, 53, 55, 57, 59, 61, 62, 63, 65, 67, 68, 69, 71, 73, 74, 75, 76, 77, 79, 81, 83, 85, 86, 87, ...}
n |
φ (m) = n |
- {14, 26, 34, 38, 50, 62, 68, 74, 76, 86, 90, 94, 98, 114, 118, 122, 124, 134, 142, 146, 152, 154, 158, 170, 174, 182, 186, 188, 194, 202, 206, 214, 218, 230, 234, 236, 242, 244, 246, 248, 254, 258, ...}
n |
φ (m) = n |
- {3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, ...}
k |
φ (x) = k |
k |
- {1, 2, 4, 8, 12, 24, 48, 72, 144, 240, 432, 480, 576, 720, 1152, 1440, 2880, 4320, 5760, 8640, 11520, 17280, 25920, 30240, 34560, 40320, 51840, 60480, 69120, 80640, 103680, 120960, 161280, ...}
φ (n) |
- {0, 1, 2, 2, 3, 2, 3, 3, 3, 3, 4, 3, 4, 3, 4, 4, 5, 3, 4, 4, 4, 4, 5, 4, 5, 4, 4, 4, 5, 4, 5, 5, 5, 5, 5, 4, 5, 4, 5, 5, 6, 4, 5, 5, 5, 5, 6, 5, 5, 5, 6, 5, 6, 4, 6, 5, 5, 5, 6, 5, 6, 5, 5, 6, 6, 5, 6, 6, 6, 5, 6, 5, 6, 5, 6, 5, 6, ...}
n |
n |
- {3, 9, 15, 27, 39, 81, 111, 183, 243, 255, 327, 363, 471, 729, 2187, 2199, 3063, 4359, 4375, 5571, 6561, 8751, 15723, 19683, 36759, 46791, 59049, 65535, 140103, 177147, 208191, 441027, 531441, ...}
n |
- {0, 1, 1, 2, 1, 5, 1, 4, 3, 7, 1, 10, 1, 9, 8, 8, 1, 15, 1, 14, 10, 13, 1, 20, 5, 15, 9, 18, 1, 32, 1, 16, 14, 19, 12, 30, ...}
See also
- Peter Luschny, Sequences related to Euler’s totient function.
- Totient valence function
- Coprimality triangle
- Coprimality
- Totatives
- Totient summatory function
- Coprimorial or product of totatives of n
- Euler’s cototient function (number of cototatives of
)n - Noncoprimorial
- Dedekind ψ function
Notes
- ↑ Harold M. Stark, An Introduction to Number Theory. Chicago: Markham Publishing Company (1970) p. 77.
- ↑ R. Crandall & C. Pomerance, Prime Numbers: A Computational Perspective. New York: Springer (2001) p. 119.
- ↑ H. E. Rose, A Course in Number Theory. Oxford: Clarendon Press (1988) p. 21.
- ↑ D. N. Lehmer, “Dickson’s History of the Theory of Numbers” Bull. Amer. Math. Soc. 26 3 (1919), 128.
- ↑ Stark, p. 78.
- ↑ Ivan Niven & Herbert S. Zuckerman, An Introduction to the Theory of Numbers. New York: John Wiley & Sons (1980) p. 48, Section 2.4, Theorem 2.15.
- ↑ For the derivation of this formula see equations (1) to (12) of: Weisstein, Eric W., Totient Function, from MathWorld—A Wolfram Web Resource.
- ↑ Stark, p. 83, Theorem 3.15.