"φ(n)" redirects here. For other uses, seePhi.Not to be confused withEuler function.
This article uses technical mathematical notation for logarithms. All instances oflog(x) without a subscript base should be interpreted as anatural logarithm, also commonly written asln(x) orloge(x).
The first thousand values ofφ(n). The points on the top line representφ(p) whenp is a prime number, which isp − 1.[1]
Innumber theory,Euler's totient function counts the positive integers up to a given integer that arerelatively prime to. It is written using the Greek letterphi as or, and may also be calledEuler's phi function. In other words, it is the number of integers in the range for which thegreatest common divisor is equal to 1.[2][3] The integers of this form are sometimes referred to astotatives of.
For example, the totatives of 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 and. Therefore,. As another example, since for the only integer in the range from 1 to is 1 itself, and.
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 to denote it: he wrote for "the multitude of numbers less than, and which have no common divisor with it".[10] This definition varies from the current definition for the totient function at but is otherwise the same. The now-standard notation[8][11] comes fromGauss's 1801 treatiseDisquisitiones Arithmeticae,[12][13] although Gauss did not use parentheses around the argument and wrote. Thus, it is often calledEuler's phi function or simply thephi function.
In 1879,J. J. Sylvester coined the termtotient for this function,[14][15] so it is also referred to asEuler's totient function, theEuler totient, orEuler's totient.[16]Jordan's totient is a generalization of Euler's.
Thecototient of is defined as. It counts the number of positive integers less than or equal to that have at least oneprime factor in common with.
This means that if, then.Proof outline: Let be the sets of positive integers which arecoprime to and less thanm,n,mn, respectively, so that, etc. Then there is abijection between andC by theChinese remainder theorem.
Proof: Sincep is a prime number, the only possible values of are, and the only way to have is ifm is a multiple ofp, that is,, and there are such multiples not greater than. Therefore, the other numbers are all relatively prime to.
Thefundamental theorem of arithmetic states that ifn > 1 there is a unique expression wherep1 <p2 < ... <pr areprime numbers and eachki ≥ 1. (The casen = 1 corresponds to theempty product.) Repeatedly using the multiplicative property ofφ and the formula forφ(pk) gives
This gives both versions of Euler's product formula.
An alternative proof that does not require the multiplicative property instead uses theinclusion-exclusion principle applied to the set, excluding the sets of integers divisible by the prime divisors.
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.
For example, using and:Unlike theEuler product and the divisor sum formula, this one does not require knowing the factors ofn. However, it does involve the calculation of the greatest common divisor ofn and every positive integer less thann, which suffices to provide the factorization anyway.
where the sum is over all positive divisorsd ofn, can be proven in several ways. (SeeArithmetical function for notational conventions.)
One proof is to note thatφ(d) is also equal to the number of possible generators of thecyclic groupCd ; specifically, ifCd = ⟨g⟩ withgd = 1, thengk is a generator for everyk coprime tod. Since every element ofCn generates a cyclicsubgroup, and each subgroupCd ⊆Cn is generated by preciselyφ(d) elements ofCn, the formula follows.[19] Equivalently, the formula can be derived by the same argument applied to themultiplicative group of thenth roots of unity and theprimitivedth roots of unity.
The formula can also be derived from elementary arithmetic.[20] For example, letn = 20 and consider the positive fractions up to 1 with denominator 20:
Put them into lowest terms:
These twenty fractions are all the positivek/d ≤ 1 whose denominators are the divisorsd = 1, 2, 4, 5, 10, 20. The fractions with 20 as denominator are those with numerators relatively prime to 20, namely1/20,3/20,7/20,9/20,11/20,13/20,17/20,19/20; by definition this isφ(20) fractions. Similarly, there areφ(10) fractions with denominator 10, andφ(5) fractions with denominator 5, etc. Thus the set of twenty fractions is split into subsets of sizeφ(d) for eachd dividing 20. A similar argument applies for anyn.
whereμ is theMöbius function, themultiplicative function defined by and for each primep andk ≥ 2. This formula may also be derived from the product formula by multiplying out to get
The first 100 values (sequenceA000010 in theOEIS) are shown in the table and graph below:
Graph of the first 100 values
φ(n) for1 ≤n ≤ 100
+
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 liney =n − 1 is anupper bound valid for alln other than one, and attained if and only ifn is a prime number. A simple lower bound is, which is rather loose: in fact, thelower limit of the graph is proportional ton/log logn.[21]
TheRSA cryptosystem is based on this theorem: it implies that theinverse of the functiona ↦ae modn, wheree is the (public) encryption exponent, is the functionb ↦bd modn, whered, the (private) decryption exponent, is themultiplicative inverse ofe moduloφ(n). The difficulty of computingφ(n) without knowing the factorization ofn is thus the difficulty of computingd: this is known as theRSA problem which can be solved by factoringn. The owner of the private key knows the factorization, since an RSA private key is constructed by choosingn as the product of two (randomly chosen) large primesp andq. Onlyn is publicly disclosed, and given thedifficulty to factor large numbers we have the guarantee that no one else knows the factorization.
The following property, which is unpublished as a specific result but has long been known,[26] has important consequences. For instance it rules out uniform distribution of the values of in the arithmetic progressions modulo for any integer.
For every fixed positive integer, the relation holds for almost all, meaning for all but values of as.
This is an elementary consequence of the fact that the sum of the reciprocals of the primes congruent to 1 modulo diverges, which itself is a corollary of the proof ofDirichlet's theorem on arithmetic progressions.
The second inequality was shown byJean-Louis Nicolas.Ribenboim says "The method of proof is interesting, in that the inequality is shown first under the assumption that theRiemann hypothesis is true, secondly under the contrary assumption."[36]: 173
due toArnold Walfisz, its proof exploiting estimates on exponential sums due toI. M. Vinogradov andN. 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
(this is currently the best known estimate of this type). The"BigO" stands for a quantity that is bounded by a constant times the function ofn inside the parentheses (which is small compared ton2).
Atotient number is a value of Euler's totient function: that is, anm for which there is at least onen for whichφ(n) =m. Thevalency ormultiplicity of a totient numberm is the number of solutions to this equation.[41] Anontotient 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 first few totient numbers are, see sequenceA002202.
The number of totient numbers up to a given limitx is
Ford (1999) proved that for every integerk ≥ 2 there is a totient numberm of multiplicityk: that is, for which the equationφ(n) =m has exactlyk solutions; this result had previously been conjectured byWacław Sierpiński,[48] and it had been obtained as a consequence ofSchinzel's hypothesis H.[44] Indeed, each multiplicity that occurs, does so infinitely often.[44][47]
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 numbern, 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 equalsn, thenn is a perfect totient number.
In the last section of theDisquisitiones[50][51] Gauss proves[52] that a regularn-gon can be constructed with straightedge and compass ifφ(n) is a power of 2. Ifn is a power of an odd prime number the formula for the totient says its totient can be a power of two only ifn is a first power andn − 1 is a power of 2. The primes that are one more than a power of 2 are calledFermat 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 regularn-gon has a straightedge-and-compass construction ifn is a product of distinct Fermat primes and any power of 2. The first few suchn are[53]
Setting up an RSA system involves choosing large prime numbersp andq, computingn =pq andk =φ(n), and finding two numberse andd such thated ≡ 1 (modk). The numbersn ande (the "encryption key") are released to the public, andd (the "decryption key") is kept private.
A message, represented by an integerm, where0 <m <n, is encrypted by computingS =me (modn).
It is decrypted by computingt =Sd (modn). Euler's Theorem can be used to show that if0 <t <n, thent =m.
The security of an RSA system would be compromised if the numbern could be efficiently factored or ifφ(n) could be efficiently computed without factoringn.
Ifp is prime, thenφ(p) =p − 1. In 1932D. H. Lehmer asked if there are any composite numbersn such thatφ(n) dividesn − 1. None are known.[54]
In 1933 he proved that if any suchn exists, it must be odd, square-free, and divisible by at least seven primes (i.e.ω(n) ≥ 7). In 1980 Cohen and Hagis proved thatn > 1020 and thatω(n) ≥ 14.[55] Further, Hagis showed that if 3 dividesn thenn > 101937042 andω(n) ≥ 298848.[56][57]
This states that there is no number with the property that for all other numbers,,. SeeFord's theorem above.
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]
^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).
^Bothφ(n) andϕ(n) are seen in the literature. These are two forms of the lower-case Greek letterphi.
^Cajori, Florian (1929).A History Of Mathematical Notations Volume II. Open Court Publishing Company. §409.
^J. J. Sylvester (1879) "On certain ternary cubic-form equations",American Journal of Mathematics,2 : 357-393; Sylvester coins the term "totient" onpage 361.
^Pollack, P. (2023), "Two problems on the distribution of Carmichael's lambda function",Mathematika,69 (4):1195–1220,arXiv:2303.14043,doi:10.1112/mtk.12222
^abRibenboim (1989). "How are the Prime Numbers Distributed? §I.C The Distribution of Values of Euler's Function".The Book of Prime Number Records (2nd ed.). New York: Springer-Verlag. pp. 172–175.doi:10.1007/978-1-4684-0507-1_5.ISBN978-1-4684-0509-5.
^Gauss proved ifn satisfies certain conditions then then-gon can be constructed. In 1837Pierre Wantzel proved the converse, if then-gon is constructible, thenn must satisfy Gauss's conditions
^Cohen, Graeme L.; Hagis, Peter Jr. (1980). "On the number of prime factors ofn ifφ(n) dividesn − 1".Nieuw Arch. Wiskd. III Series.28:177–185.ISSN0028-9825.Zbl0436.10002.
^Hagis, Peter Jr. (1988). "On the equationM·φ(n) =n − 1".Nieuw Arch. Wiskd. IV Series.6 (3):255–261.ISSN0028-9825.Zbl0668.10006.
^Broughan, Kevin (2017).Equivalents of the Riemann Hypothesis, Volume One: Arithmetic Equivalents (First ed.). Cambridge University Press.ISBN978-1-107-19704-6. Corollary 5.35
TheDisquisitiones 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 theDisquisitiones are of the form Gauss, DA, art.nnn.
Dickson, Leonard Eugene, "History Of The Theory Of Numbers", vol 1, chapter 5 "Euler's Function, Generalizations; Farey Series", Chelsea Publishing 1952
Gauss, Carl Friedrich (1965),Untersuchungen uber hohere Arithmetik (Disquisitiones Arithmeticae & other papers on number theory) (Second edition), translated by Maser, H., New York: Chelsea,ISBN0-8284-0191-8