In number theory, the totient 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. For example, 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 ; 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, is the order of the group of units of the ring . This fact, together with Lagrange's theorem, provides a proof for Euler's theorem.
It follows from the definition that , and if p is prime, then . Moreover, is a multiplicative function; if m and n are coprime then . (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, via the Chinese remainder theorem.) The value of can thus be computed using the fundamental theorem of arithmetic: if
where the pj are distinct primes, then
This last formula is an Euler product and is often written as
with the product ranging only over the distinct primes p dividing n.
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.
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 :
The two generating functions presented here are both consequences of the fact that
A Dirichlet series involving (n) is
where ζ(s) is the Riemann Zeta function. This is derived as follows:
A Lambert series generating function is
which converges for |q|<1.
This follows from
The growth of as a function of n is an interesting question, since the first impression from small n that 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.
A proof of these formulas may be found here.
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.)
Proofs of some of these identities may be found here.
For prime n, clearly .
For a composite number n we have
For randomly large n, these bounds still cannot be improved, or to be more precise:
A pair of inequalities combining the function and the divisor function are:
The last two are proved on the page on proofs of totient identities.
| issue = 1 | journal = Annals of Mathematics | pages = 283–311 | title = The number of solutions of φ(x) = m | volume = 150 | year = 1999}}.