- Euler's totient function
-
For other functions named after Euler, see List of topics named after Leonhard Euler.
In number theory, the totient φ(n) of a positive integer n is defined to be the number of positive integers less than or equal to n that are coprime to n (i.e. having no common positive factors other than 1). In particular φ(1) = 1 since 1 is coprime to itself (1 being the only natural number with this property). For example, φ(9) = 6 since the six numbers 1, 2, 4, 5, 7 and 8 are coprime to 9. The function φ so defined is the totient function. The totient is usually called the Euler totient or Euler's totient, after the Swiss mathematician Leonhard Euler, who studied it. The totient function is also called Euler's phi function or simply the phi function, since it is commonly denoted by the Greek letter phi (φ). The cototient of n is defined as n − φ(n), in other words the number of positive integers less than or equal to n that are not coprime to n.
The totient function is important mainly because it gives the size of the multiplicative group of integers modulo n. More precisely, φ(n) is the order of the group of units of the ring . This fact, together with Lagrange's theorem on the possible sizes of subgroups of a group, provides a proof for Euler's theorem that for all a coprime to n. The totient function also plays a key role in the definition of the RSA encryption system.
Contents
Computing Euler's function
The totient φ is a multiplicative function; if m and n are coprime then φ(mn) = φ(m)φ(n). (Sketch of proof: let A, B, C be the sets of residue classes modulo-and-coprime-to m, n, mn respectively; then there is a bijection between A × B and C, by the Chinese remainder theorem.)
If n = pk, where p is prime, then .
Proof: It is easy to list all positive integers that are less than or equal to pk and not relatively prime to pk. They are . They are all multiples of p and we have exactly pk − 1 of them. Therefore, there are exactly pk − pk − 1 = (p − 1)pk − 1 positive integers less than or equal to pk that are relatively prime to pk.
The value of φ(n) for n > 1 can thus be computed using the fundamental theorem of arithmetic: if
where each pi is a distinct prime, then
This last formula is an Euler product and is often written in the equivalent form (multiplying top and bottom by )
with the product ranging only over the distinct primes p dividing n.
Proof: Repeatedly applying the above mentioned theorems that we get
This can be rewritten as
Computing example
In words, this says that the distinct prime factors of 36 are 2 and 3; half of the thirty-six integers from 1 to 36 are divisible by 2, leaving eighteen; a third of those are divisible by 3, leaving twelve coprime to 36. And indeed there are twelve: 1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, and 35.
Some values of the function
The first 99 values (sequence A000010 in OEIS) are shown in the table and graph below:
φ(n) +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 0+ 1 1 2 2 4 2 6 4 6 10+ 4 10 4 12 6 8 8 16 6 18 20+ 8 12 10 22 8 20 12 18 12 28 30+ 8 30 16 20 16 24 12 36 18 24 40+ 16 40 12 42 20 24 22 46 16 42 50+ 20 32 24 52 18 40 24 36 28 58 60+ 16 60 30 36 32 48 20 66 32 44 70+ 24 70 24 72 36 40 36 60 24 78 80+ 32 54 40 82 24 64 42 56 40 88 90+ 24 72 44 60 46 72 32 96 42 60 Note that the lower bound of y = 4n/15 ≈ .267n only occurs where n is a multiple of 30. (This is not a lower bound for the whole totient function, but only for these first few values of n. For example, ; ; and .)
Properties
- φ(pα) = pα − pα − 1 for prime p and .
- where d = gcd(m,n).
- where m = 2k.
- φ(m) = φ(2m) where m = 2k+1.
- (See lcm).
- implies .
- φ(n) is even for . Moreover, if n has r distinct odd prime factors, .
- Schramm (2008) has shown that:
The number φ(n) is also equal to the number of possible generators of the cyclic group Cn (and therefore also to the degree of the cyclotomic polynomial φn). Since every element of Cn generates a cyclic subgroup and the subgroups of Cn are of the form Cd where d divides n (written as d | n), we get
where the sum extends over all positive divisors d of n.
We can now use the Möbius inversion formula to "invert" this sum and get another formula for φ(n):
where μ is the usual Möbius function defined on the positive integers.
According to Euler's theorem, if a is coprime to n, that is, gcd(a, n) = 1, then
This follows from Lagrange's theorem and the fact that a belongs to the multiplicative group of iff a is coprime to n.
Generating functions
The two generating functions presented here are both consequences of the fact that
∑ φ(d) = n. d | n Which, in the notation of Dirichlet convolution of Multiplicative function, says:
- φ * 1 = Id
The Dirichlet series for φ(n) may be written in terms of the Riemann zeta function by taking Dirichlet series of both sides and rearranging to get:
A Lambert series generating function is
which converges for |q|<1.
This follows from
which is
Growth of the function
The growth of φ(n) as a function of n is an interesting question, since the first impression from small n that φ(n) might be noticeably smaller than n is somewhat misleading. Asymptotically we have
for any given ε > 0 and n > N(ε). In fact if we consider
we can write that, from the formula above, as the product of factors
taken over the prime numbers p dividing n. Therefore the values of n corresponding to particularly small values of the ratio are those n that are the product of an initial segment of the sequence of all primes. From the prime number theorem it can be shown that a constant ε in the formula above can therefore be replaced by
φ is also generally close to n in an average sense:
where the big O is the Landau symbol. This also says that the probability of two positive integers chosen at random from being relatively prime approaches when n tends to infinity. A related result is the average order of , which is described by
Because , one can also express the formula this way.
Other formulas involving Euler's function
Because modulo an − 1, a has order n, but we also have
- For any a > 1 and n > 6 such that there exists an such that .
where m > 1 is a positive integer and ω(m) designates the number of distinct prime factors of m. (This formula counts the number of naturals less than or equal to n and relatively prime to m, additional material is listed among the external links.)
Inequalities
Some inequalities involving the φ function are:
- for n > 2, where γ is Euler's constant,[1]
- for n > 0,
and
For prime n, clearly φ(n) = n − 1.
For a composite number n we have
- .
For any even number 2n we have
where equality holds only if n is a power of two.
For arbitrarily large n, these bounds still cannot be improved, or to be more precise:
- The first bound follows by considering n as the product of the first k primes. The second follows from letting n range over the primes.[2]
A pair of inequalities combining the φ function and the σ divisor function are:
Ford's theorem
Ford (1999) proved that for every integer k ≥ 2 there is a number m for which the equation φ(x) = m has exactly k solutions; this result had previously been conjectured by Wacław Sierpiński. However, no such m is known for k = 1, and according to Carmichael's totient function conjecture it is believed that in this case no such m exists.
See also
- Carmichael function
- Generalizations of Fermat's little theorem
- Multiplicative group of integers modulo n
Notes
- ^ Bach, E.; Shallit, J. (1996), "Theorem 8.8.7", Algorithmic Number Theory, 1, Cambridge, MA: MIT Press, p. 234, ISBN 0-262-02405-5, http://books.google.com/books?id=iJx1lP9ZcIkC&pg=PA234
- ^ a b G.H. Hardy, E. M. Wright (1979), An Introduction to the Theory of Numbers (Fifth Edition), Oxford: Clarendon Press, pp. 267, ISBN 0 19 853171 0
References
- Abramowitz, M.; Stegun, I. A. (1964), Handbook of Mathematical Functions, New York: Dover Publications, ISBN 0-486-61272-4. See paragraph 24.3.2.
- Ford, K. (1999), "The number of solutions of φ(x) = m", Annals of Mathematics 150 (1): 283–311, doi:10.2307/121103, JSTOR 121103, MR1715326.
- Schramm, Wolfgang (2008), "The Fourier transform of functions of the greatest common divisor", Electronic Journal of Combinatorial Number Theory A50 (8(1)), http://www.integers-ejcnt.org/vol8.html.
External links
- Kirby Urner, Computing totient function in Python and scheme, (2003)
- Euler's totient function calculator in JavaScript - up to 20 digits
- Miyata, Daisuke & Yamashita, Michinori, Derived logarithmic function of Euler's function
- Bordellès, Olivier, Numbers prime to q in [1,n]
- Plytage, Loomis, Polhill Summing Up The Euler Phi Function
Categories:- Number theory
- Modular arithmetic
- Multiplicative functions
Wikimedia Foundation. 2010.