Euler's totient function

From testwiki
Jump to navigation Jump to search

Template:Short description Template:Hatnote group

The first thousand values of Template:Math. The points on the top line represent Template:Math when Template:Mvar is a prime number, which is Template:Math[1]

In number theory, Euler's totient function counts the positive integers up to a given integer Template:Mvar that are relatively prime to Template:Mvar. It is written using the Greek letter phi as φ(n) or ϕ(n), and may also be called Euler's phi function. In other words, it is the number of integers Template:Mvar in the range Template:Math for which the greatest common divisor Template:Math is equal to 1.[2][3] The integers Template:Mvar of this form are sometimes referred to as totatives of Template:Mvar.

For example, the totatives of Template:Math are the six numbers 1, 2, 4, 5, 7 and 8. They are all relatively prime to 9, but the other three numbers in this range, 3, 6, and 9 are not, since Template:Math and Template:Math. Therefore, Template:Math. As another example, Template:Math since for Template:Math the only integer in the range from 1 to Template:Mvar is 1 itself, and Template:Math.

Euler's totient function is a multiplicative function, meaning that if two numbers Template:Mvar and Template:Mvar are relatively prime, then Template:Math.[4][5] This function gives the order of the [[multiplicative group of integers modulo n|multiplicative group of integers modulo Template:Mvar]] (the group of units of the ring /n).[6] It is also used for defining the RSA encryption system.

History, terminology, and notation

Leonhard Euler introduced the function in 1763.[7][8][9] However, he did not at that time choose any specific symbol to denote it. In a 1784 publication, Euler studied the function further, choosing the Greek letter Template:Mvar to denote it: he wrote Template:Math for "the multitude of numbers less than Template:Mvar, and which have no common divisor with it".[10] This definition varies from the current definition for the totient function at Template:Math but is otherwise the same. The now-standard notation[8][11] Template:Math comes from Gauss's 1801 treatise Disquisitiones Arithmeticae,[12][13] although Gauss did not use parentheses around the argument and wrote Template:Math. Thus, it is often called Euler's phi function or simply the phi function.

In 1879, J. J. Sylvester coined the term totient for this function,[14][15] so it is also referred to as Euler's totient function, the Euler totient, or Euler's totient.[16] Jordan's totient is a generalization of Euler's.

The cototient of Template:Mvar is defined as Template:Math. It counts the number of positive integers less than or equal to Template:Mvar that have at least one prime factor in common with Template:Mvar.

Computing Euler's totient function

There are several formulae for computing Template:Math.

Euler's product formula

It states

φ(n)=npn(11p),

where the product is over the distinct prime numbers dividing Template:Mvar. (For notation, see Arithmetical function.)

An equivalent formulation is φ(n)=p1k11(p11)p2k21(p21)prkr1(pr1), where n=p1k1p2k2prkr is the prime factorization of n (that is, p1,p2,,pr are distinct prime numbers).

The proof of these formulae depends on two important facts.

Phi is a multiplicative function

This means that if Template:Math, then Template:Math. Proof outline: Let Template:Mvar, Template:Mvar, Template:Mvar be the sets of positive integers which are coprime to and less than Template:Mvar, Template:Mvar, Template:Mvar, respectively, so that Template:Math, etc. Then there is a bijection between Template:Math and Template:Mvar by the Chinese remainder theorem.

Value of phi for a prime power argument

If Template:Mvar is prime and Template:Math, then

φ(pk)=pkpk1=pk1(p1)=pk(11p).

Proof: Since Template:Mvar is a prime number, the only possible values of Template:Math are Template:Math, and the only way to have Template:Math is if Template:Mvar is a multiple of Template:Mvar, that is, Template:Math, and there are Template:Math such multiples not greater than Template:Math. Therefore, the other Template:Math numbers are all relatively prime to Template:Math.

Proof of Euler's product formula

The fundamental theorem of arithmetic states that if Template:Math there is a unique expression n=p1k1p2k2prkr, where Template:Math are prime numbers and each Template:Math. (The case Template:Math corresponds to the empty product.) Repeatedly using the multiplicative property of Template:Mvar and the formula for Template:Math gives

φ(n)=φ(p1k1)φ(p2k2)φ(prkr)=p1k1(11p1)p2k2(11p2)prkr(11pr)=p1k1p2k2prkr(11p1)(11p2)(11pr)=n(11p1)(11p2)(11pr).

This gives both versions of Euler's product formula.

An alternative proof that does not require the multiplicative property instead uses the inclusion-exclusion principle applied to the set {1,2,,n}, excluding the sets of integers divisible by the prime divisors.

Example

φ(20)=φ(225)=20(112)(115)=201245=8.

In words: the distinct prime factors of 20 are 2 and 5; half of the twenty integers from 1 to 20 are divisible by 2, leaving ten; a fifth of those are divisible by 5, leaving eight numbers coprime to 20; these are: 1, 3, 7, 9, 11, 13, 17, 19.

The alternative formula uses only integers:φ(20)=φ(2251)=221(21)511(51)=2114=8.

Fourier transform

The totient is the discrete Fourier transform of the gcd, evaluated at 1.[17] Let

{𝐱}[m]=k=1nxke2πimkn

where Template:Math for Template:Math. Then

φ(n)={𝐱}[1]=k=1ngcd(k,n)e2πikn.

The real part of this formula is

φ(n)=k=1ngcd(k,n)cos2πkn.

For example, using cosπ5=5+14 and cos2π5=514:φ(10)=gcd(1,10)cos2π10+gcd(2,10)cos4π10+gcd(3,10)cos6π10++gcd(10,10)cos20π10=1(5+14)+2(514)+1(514)+2(5+14)+5(1)+ 2(5+14)+1(514)+2(514)+1(5+14)+10(1)=4.Unlike the Euler product and the divisor sum formula, this one does not require knowing the factors of Template:Mvar. However, it does involve the calculation of the greatest common divisor of Template:Mvar and every positive integer less than Template:Mvar, which suffices to provide the factorization anyway.

Divisor sum

The property established by Gauss,[18] that

dnφ(d)=n,

where the sum is over all positive divisors Template:Mvar of Template:Mvar, can be proven in several ways. (See Arithmetical function for notational conventions.)

One proof is to note that Template:Math is also equal to the number of possible generators of the cyclic group Template:Math ; specifically, if Template:Math with Template:Math, then Template:Math is a generator for every Template:Mvar coprime to Template:Mvar. Since every element of Template:Math generates a cyclic subgroup, and each subgroup Template:Math is generated by precisely Template:Math elements of Template:Math, the formula follows.[19] Equivalently, the formula can be derived by the same argument applied to the [[Root of unity#Group of nth roots of unity|multiplicative group of the Template:Mvarth roots of unity]] and the [[primitive root of unity|primitive Template:Mvarth roots of unity]].

The formula can also be derived from elementary arithmetic.[20] For example, let Template:Math and consider the positive fractions up to 1 with denominator 20:

120,220,320,420,520,620,720,820,920,1020,1120,1220,1320,1420,1520,1620,1720,1820,1920,2020.

Put them into lowest terms:

120,110,320,15,14,310,720,25,920,12,1120,35,1320,710,34,45,1720,910,1920,11

These twenty fractions are all the positive Template:Sfrac ≤ 1 whose denominators are the divisors Template:Math. The fractions with 20 as denominator are those with numerators relatively prime to 20, namely Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac; by definition this is Template:Math fractions. Similarly, there are Template:Math fractions with denominator 10, and Template:Math fractions with denominator 5, etc. Thus the set of twenty fractions is split into subsets of size Template:Math for each Template:Math dividing 20. A similar argument applies for any n.

Möbius inversion applied to the divisor sum formula gives

φ(n)=dnμ(d)nd=ndnμ(d)d,

where Template:Mvar is the Möbius function, the multiplicative function defined by μ(p)=1 and μ(pk)=0 for each prime Template:Math and Template:Math. This formula may also be derived from the product formula by multiplying out pn(11p) to get dnμ(d)d.

An example:φ(20)=μ(1)20+μ(2)10+μ(4)5+μ(5)4+μ(10)2+μ(20)1=120110+0514+12+01=8.

Some values

The first 100 values Template:OEIS are shown in the table and graph below:

Graph of the first 100 values
Template:Math for Template:Math
+ 1 2 3 4 5 6 7 8 9 10
0 1 1 2 2 4 2 6 4 6 4
10 10 4 12 6 8 8 16 6 18 8
20 12 10 22 8 20 12 18 12 28 8
30 30 16 20 16 24 12 36 18 24 16
40 40 12 42 20 24 22 46 16 42 20
50 32 24 52 18 40 24 36 28 58 16
60 60 30 36 32 48 20 66 32 44 24
70 70 24 72 36 40 36 60 24 78 32
80 54 40 82 24 64 42 56 40 88 24
90 72 44 60 46 72 32 96 42 60 40

In the graph at right the top line Template:Math is an upper bound valid for all Template:Mvar other than one, and attained if and only if Template:Mvar is a prime number. A simple lower bound is φ(n)n/2, which is rather loose: in fact, the lower limit of the graph is proportional to Template:Math.[21] Template:Clear

Euler's theorem

Template:Main article

This states that if Template:Mvar and Template:Mvar are relatively prime then

aφ(n)1modn.

The special case where Template:Mvar is prime is known as Fermat's little theorem.

This follows from Lagrange's theorem and the fact that Template:Math is the order of the [[multiplicative group of integers modulo n|multiplicative group of integers modulo Template:Mvar]].

The RSA cryptosystem is based on this theorem: it implies that the inverse of the function Template:Math, where Template:Mvar is the (public) encryption exponent, is the function Template:Math, where Template:Mvar, the (private) decryption exponent, is the multiplicative inverse of Template:Mvar modulo Template:Math. The difficulty of computing Template:Math without knowing the factorization of Template:Mvar is thus the difficulty of computing Template:Mvar: this is known as the RSA problem which can be solved by factoring Template:Mvar. The owner of the private key knows the factorization, since an RSA private key is constructed by choosing Template:Mvar as the product of two (randomly chosen) large primes Template:Mvar and Template:Mvar. Only Template:Mvar is publicly disclosed, and given the difficulty to factor large numbers we have the guarantee that no one else knows the factorization.

Other formulae

Menon's identity

Template:Main article In 1965 P. Kesava Menon proved

gcd(k,n)=11kngcd(k1,n)=φ(n)d(n),

where Template:Math is the number of divisors of Template:Mvar.

Divisibility by any fixed positive integer

The following property, which is part of the « folklore » (i.e., apparently unpublished as a specific result:[26] see the introduction of this article in which it is stated as having « long been known ») has important consequences. For instance it rules out uniform distribution of the values of φ(n) in the arithmetic progressions modulo q for any integer q>1.

  • For every fixed positive integer q, the relation q|φ(n) holds for almost all n, meaning for all but o(x) values of nx as x.

This is an elementary consequence of the fact that the sum of the reciprocals of the primes congruent to 1 modulo q diverges, which itself is a corollary of the proof of Dirichlet's theorem on arithmetic progressions.

Generating functions

The Dirichlet series for Template:Math may be written in terms of the Riemann zeta function as:[27]

n=1φ(n)ns=ζ(s1)ζ(s)

where the left-hand side converges for (s)>2.

The Lambert series generating function is[28]

n=1φ(n)qn1qn=q(1q)2

which converges for Template:Math.

Both of these are proved by elementary series manipulations and the formulae for Template:Math.

Growth rate

In the words of Hardy & Wright, the order of Template:Math is "always 'nearly Template:Mvar'."[29]

First[30]

limsupφ(n)n=1,

but as n goes to infinity,[31] for all Template:Math

φ(n)n1δ.

These two formulae can be proved by using little more than the formulae for Template:Math and the divisor sum function Template:Math.

In fact, during the proof of the second formula, the inequality

6π2<φ(n)σ(n)n2<1,

true for Template:Math, is proved.

We also have[21]

liminfφ(n)nloglogn=eγ.

Here Template:Mvar is Euler's constant, Template:Math, so Template:Math and Template:Math.

Proving this does not quite require the prime number theorem.[32][33] Since Template:Math goes to infinity, this formula shows that

liminfφ(n)n=0.

In fact, more is true.[34][35][36]

φ(n)>neγloglogn+3loglognfor n>2

and

φ(n)<neγloglognfor infinitely many n.

The second inequality was shown by Jean-Louis Nicolas. Ribenboim says "The method of proof is interesting, in that the inequality is shown first under the assumption that the Riemann hypothesis is true, secondly under the contrary assumption."[36]Template:Rp

For the average order, we have[23][37]

φ(1)+φ(2)++φ(n)=3n2π2+O(n(logn)23(loglogn)43)as n,

due to Arnold Walfisz, its proof exploiting estimates on exponential sums due to I. M. Vinogradov and N. M. Korobov. By a combination of van der Corput's and Vinogradov's methods, H.-Q. Liu (On Euler's function.Proc. Roy. Soc. Edinburgh Sect. A 146 (2016), no. 4, 769–775) improved the error term to

O(n(logn)23(loglogn)13)

(this is currently the best known estimate of this type). The [[Big O notation|"Big Template:Mvar"]] stands for a quantity that is bounded by a constant times the function of Template:Mvar inside the parentheses (which is small compared to Template:Math).

This result can be used to prove[38] that the probability of two randomly chosen numbers being relatively prime is Template:Sfrac.

Ratio of consecutive values

In 1950 Somayajulu proved[39][40]

liminfφ(n+1)φ(n)=0and[5px]limsupφ(n+1)φ(n)=.

In 1954 Schinzel and Sierpiński strengthened this, proving[39][40] that the set

{φ(n+1)φ(n),n=1,2,}

is dense in the positive real numbers. They also proved[39] that the set

{φ(n)n,n=1,2,}

is dense in the interval (0,1).

Totient numbers

A totient number is a value of Euler's totient function: that is, an Template:Mvar for which there is at least one Template:Mvar for which Template:Math. The valency or multiplicity of a totient number Template:Mvar is the number of solutions to this equation.[41] A nontotient is a natural number which is not a totient number. Every odd integer exceeding 1 is trivially a nontotient. There are also infinitely many even nontotients,[42] and indeed every positive integer has a multiple which is an even nontotient.[43]

The number of totient numbers up to a given limit Template:Mvar is

xlogxe(C+o(1))(logloglogx)2

for a constant Template:Math.[44]

If counted accordingly to multiplicity, the number of totient numbers up to a given limit Template:Mvar is

|{n:φ(n)x}|=ζ(2)ζ(3)ζ(6)x+R(x)

where the error term Template:Mvar is of order at most Template:Math for any positive Template:Mvar.[45]

It is known that the multiplicity of Template:Mvar exceeds Template:Math infinitely often for any Template:Math.[46][47]

Ford's theorem

Template:Harvtxt proved that for every integer Template:Math there is a totient number Template:Mvar of multiplicity Template:Mvar: that is, for which the equation Template:Math has exactly Template:Mvar solutions; this result had previously been conjectured by Wacław Sierpiński,[48] and it had been obtained as a consequence of Schinzel's hypothesis H.[44] Indeed, each multiplicity that occurs, does so infinitely often.[44][47]

However, no number Template:Mvar is known with multiplicity Template:Math. Carmichael's totient function conjecture is the statement that there is no such Template:Mvar.[49]

Perfect totient numbers

Template:Main article A perfect totient number is an integer that is equal to the sum of its iterated totients. That is, we apply the totient function to a number n, apply it again to the resulting totient, and so on, until the number 1 is reached, and add together the resulting sequence of numbers; if the sum equals n, then n is a perfect totient number.

Applications

Cyclotomy

Template:Main article

In the last section of the Disquisitiones[50][51] Gauss proves[52] that a regular Template:Mvar-gon can be constructed with straightedge and compass if Template:Math is a power of 2. If Template:Mvar is a power of an odd prime number the formula for the totient says its totient can be a power of two only if Template:Mvar is a first power and Template:Math is a power of 2. The primes that are one more than a power of 2 are called Fermat primes, and only five are known: 3, 5, 17, 257, and 65537. Fermat and Gauss knew of these. Nobody has been able to prove whether there are any more.

Thus, a regular Template:Mvar-gon has a straightedge-and-compass construction if n is a product of distinct Fermat primes and any power of 2. The first few such Template:Mvar are[53]

2, 3, 4, 5, 6, 8, 10, 12, 15, 16, 17, 20, 24, 30, 32, 34, 40,... Template:OEIS.

Prime number theorem for arithmetic progressions

Template:Main article

The RSA cryptosystem

Template:Main article

Setting up an RSA system involves choosing large prime numbers Template:Mvar and Template:Mvar, computing Template:Math and Template:Math, and finding two numbers Template:Mvar and Template:Mvar such that Template:Math. The numbers Template:Mvar and Template:Mvar (the "encryption key") are released to the public, and Template:Mvar (the "decryption key") is kept private.

A message, represented by an integer Template:Mvar, where Template:Math, is encrypted by computing Template:Math.

It is decrypted by computing Template:Math. Euler's Theorem can be used to show that if Template:Math, then Template:Math.

The security of an RSA system would be compromised if the number Template:Mvar could be efficiently factored or if Template:Math could be efficiently computed without factoring Template:Mvar.

Unsolved problems

Lehmer's conjecture

Template:Main article

If Template:Mvar is prime, then Template:Math. In 1932 D. H. Lehmer asked if there are any composite numbers Template:Mvar such that Template:Math divides Template:Math. None are known.[54]

In 1933 he proved that if any such Template:Mvar exists, it must be odd, square-free, and divisible by at least seven primes (i.e. Template:Math). In 1980 Cohen and Hagis proved that Template:Math and that Template:Math.[55] Further, Hagis showed that if 3 divides Template:Mvar then Template:Math and Template:Math.[56][57]

Carmichael's conjecture

Template:Main article

This states that there is no number Template:Mvar with the property that for all other numbers Template:Mvar, Template:Math, Template:Math. See Ford's theorem above.

As stated in the main article, if there is a single counterexample to this conjecture, there must be infinitely many counterexamples, and the smallest one has at least ten billion digits in base 10.[41]

Riemann hypothesis

The Riemann hypothesis is true if and only if the inequality

nφ(n)<eγloglogn+eγ(4+γlog4π)logn

is true for all Template:Math where Template:Mvar is Euler's constant and Template:Math is the product of the first Template:Math primes.[58]

See also

Notes

Template:Reflist

References

Template:Refbegin

The Disquisitiones Arithmeticae has been translated from Latin into English and German. The German edition includes all of Gauss's papers on number theory: all the proofs of quadratic reciprocity, the determination of the sign of the Gauss sum, the investigations into biquadratic reciprocity, and unpublished notes.

References to the Disquisitiones are of the form Gauss, DA, art. nnn.

Template:Refend

Template:Totient

  1. Template:Cite web
  2. Template:Harvtxt
  3. Template:Harvtxt
  4. Template:Harvtxt
  5. Template:Harvtxt
  6. See Euler's theorem.
  7. L. Euler "Theoremata arithmetica nova methodo demonstrata" (An arithmetic theorem proved by a new method), Novi commentarii academiae scientiarum imperialis Petropolitanae (New Memoirs of the Saint-Petersburg Imperial Academy of Sciences), 8 (1763), 74–104. (The work was presented at the Saint-Petersburg Academy on October 15, 1759. A work with the same title was presented at the Berlin Academy on June 8, 1758). Available on-line in: Ferdinand Rudio, Template:Abbr, Leonhardi Euleri Commentationes Arithmeticae, volume 1, in: Leonhardi Euleri Opera Omnia, series 1, volume 2 (Leipzig, Germany, B. G. Teubner, 1915), pages 531–555. On page 531, Euler defines Template:Mvar as the number of integers that are smaller than Template:Mvar and relatively prime to Template:Mvar (... aequalis sit multitudini numerorum ipso N minorum, qui simul ad eum sint primi, ...), which is the phi function, φ(N).
  8. 8.0 8.1 Sandifer, p. 203
  9. Graham et al. p. 133 note 111
  10. L. Euler, Speculationes circa quasdam insignes proprietates numerorum, Acta Academiae Scientarum Imperialis Petropolitinae, vol. 4, (1784), pp. 18–30, or Opera Omnia, Series 1, volume 4, pp. 105–115. (The work was presented at the Saint-Petersburg Academy on October 9, 1775).
  11. Both Template:Math and Template:Math are seen in the literature. These are two forms of the lower-case Greek letter phi.
  12. Gauss, Disquisitiones Arithmeticae article 38
  13. Template:Cite book
  14. J. J. Sylvester (1879) "On certain ternary cubic-form equations", American Journal of Mathematics, 2 : 357-393; Sylvester coins the term "totient" on page 361.
  15. Template:Cite OED2
  16. Template:Cite web
  17. Template:Harvtxt
  18. Gauss, DA, art 39
  19. Gauss, DA art. 39, arts. 52-54
  20. Graham et al. pp. 134-135
  21. 21.0 21.1 Template:Harvnb
  22. Dineva (in external refs), prop. 1
  23. 23.0 23.1 23.2 Template:Cite book
  24. Template:Citation
  25. 25.0 25.1 Template:Cite journal
  26. Template:Citation
  27. Template:Harvnb
  28. Template:Harvnb
  29. Template:Harvnb
  30. Template:Harvnb
  31. Template:Harvnb
  32. In fact Chebyshev's theorem (Template:Harvnb) and Mertens' third theorem is all that is needed.
  33. Template:Harvnb
  34. Theorem 15 of Template:Cite journal
  35. Bach & Shallit, thm. 8.8.7
  36. 36.0 36.1 Template:Cite book
  37. Sándor, Mitrinović & Crstici (2006) pp.24–25
  38. Template:Harvnb
  39. 39.0 39.1 39.2 Ribenboim, p.38
  40. 40.0 40.1 Sándor, Mitrinović & Crstici (2006) p.16
  41. 41.0 41.1 Guy (2004) p.144
  42. Sándor & Crstici (2004) p.230
  43. Template:Cite journal
  44. 44.0 44.1 44.2 Template:Cite journal Reprinted in Analytic and Elementary Number Theory: A Tribute to Mathematical Legend Paul Erdos, Developments in Mathematics, vol. 1, 1998, Template:Doi, Template:ISBN. Updated and corrected in Template:ArXiv, 2011.
  45. Sándor et al (2006) p.22
  46. Sándor et al (2006) p.21
  47. 47.0 47.1 Guy (2004) p.145
  48. Sándor & Crstici (2004) p.229
  49. Sándor & Crstici (2004) p.228
  50. Gauss, DA. The 7th § is arts. 336–366
  51. Gauss proved if Template:Mvar satisfies certain conditions then the Template:Mvar-gon can be constructed. In 1837 Pierre Wantzel proved the converse, if the Template:Mvar-gon is constructible, then Template:Mvar must satisfy Gauss's conditions
  52. Gauss, DA, art 366
  53. Gauss, DA, art. 366. This list is the last sentence in the Disquisitiones
  54. Ribenboim, pp. 36–37.
  55. Template:Cite journal
  56. Template:Cite journal
  57. Guy (2004) p.142
  58. Template:Cite book Corollary 5.35