Read · 2 min

Euler's totient function for a positive integer nn is defined as the number of relatively prime numbers to nn that are less than nn. This is commonly denoted as ϕ(n)\phi(n). One important and useful property of this function is that it is multiplicative, meaning that if mm and nn are relatively prime, then ϕ(mn)=ϕ(m)⋅ϕ(n)\phi(mn)=\phi(m)\cdot \phi(n).

However, this is not the only important thing about Euler's totient function; it also has a formula: If n=p1e1p2e2⋯pkekn={p_1}^{e_1}{p_2}^{e_2}\cdots {p_k}^{e_k} where p1,p2,...,pnp_1,p_2,...,p_n are primes, then ϕ(n)=n∏j=1k(1−1pj)\phi(n)=n\prod\limits_{j=1}^{k} (1-\frac{1}{p_j})=n(1−1p1)(1−1p2)⋯(1−1pk).=n(1-\frac{1}{p_1})(1-\frac{1}{p_2})\cdots (1-\frac{1}{p_k}).

In order to prove this statement, we can use two methods, PIE (Principle of Inclusion and Exclusion) or simple algebra and number theory. I'm going to show the latter; however, we will first prove a simple fact:

If n=pen=p^e, then ϕ(n)=pe(1−1p)\phi(n)=p^e(1-\frac{1}{p}). This is very simple to prove. If pp is the only prime factor of nn, then the numbers that are not relatively prime with nn (not including 11 since 11 is relatively prime to every number) are p,2p,3p,...,(pe−1−1)p,(pe−1)p.p, 2p, 3p, ..., (p^{e-1}-1)p, (p^{e-1})p. Clearly, there are pe−1p^{e-1} numbers less than or equal to nn that are not relatively prime to nn. Hence, the total number of relatively prime numbers less than or equal to nn is pe−pe−1=pe(1−1p).p^e-p^{e-1}=p^e(1-\frac{1}{p}).

Now time for the real proof. Let n=p1e1p2e2⋯pkekn={p_1}^{e_1}{p_2}^{e_2}\cdots {p_k}^{e_k} where p1,...,pkp_1,...,p_k are prime. Because the totient function is multiplicative, we can express ϕ(n)=ϕ(p1e1p2e2⋯pkek)\phi(n)=\phi({p_1}^{e_1}{p_2}^{e_2}\cdots {p_k}^{e_k})=ϕ(p1e1)ϕ(p2e2)⋯ϕ(pkek).=\phi({p_1}^{e_1})\phi({p_2}^{e_2})\cdots \phi({p_k}^{e_k}). Using what we just proved in the above paragraph, we can substitute ϕ(p1e1)=p1e1(1−1p1),\phi({p_1}^{e_1})={p_1}^{e_1}(1-\frac{1}{p_1}),ϕ(p2e2)=p2e2(1−1p2),\phi({p_2}^{e_2})={p_2}^{e_2}(1-\frac{1}{p_2}), and so on. Substituting these in and rearranging the terms, we get ϕ(p1e1)ϕ(p2e2)⋯ϕ(pkek)\phi({p_1}^{e_1})\phi({p_2}^{e_2})\cdots \phi({p_k}^{e_k})=p1e1p2e2⋯pkek(1−1p1)(1−1p2)⋯(1−1pk)={p_1}^{e_1}{p_2}^{e_2}\cdots {p_k}^{e_k}(1-\frac{1}{p_1})(1-\frac{1}{p_2})\cdots (1-\frac{1}{p_k}) and since n=p1e1p2e2⋯pkekn={p_1}^{e_1}{p_2}^{e_2}\cdots {p_k}^{e_k}, we arrive at p1e1p2e2⋯pkek(1−1p1)(1−1p2)⋯(1−1pk){p_1}^{e_1}{p_2}^{e_2}\cdots {p_k}^{e_k}(1-\frac{1}{p_1})(1-\frac{1}{p_2})\cdots (1-\frac{1}{p_k})=n(1−1p1)(1−1p2)⋯(1−1pk)=n(1-\frac{1}{p_1})(1-\frac{1}{p_2})\cdots (1-\frac{1}{p_k}) which is exactly what we want. Although we now know a formula, sometimes directly using the property that ϕ(n)\phi(n) is multiplicative is faster when computing ϕ(n)\phi(n).

However, what is this function used for? One theorem it is used in is Euler's Theorem. Although I won't prove it (see Asif E Elahi's explanation on totient functions for a proof), it says that for any positive integer aa and nn that are relatively prime, aϕ(n)≡1(modn).a^{\phi(n)}\equiv 1 \pmod{n}. This is quite useful and we can quickly verify Fermat's Little Theorem, which states that for any p∤ap\nmid a where pp is prime and aa is a positive integer, ap−1≡1(modp).a^{p-1} \equiv 1\pmod{p}. Plugging aa and pp into Euler's theorem (which is legal since aa and pp are relatively prime), we get aϕ(p)≡1(modp)a^{\phi(p)}\equiv 1\pmod{p} and since ϕ(p)=p−1\phi(p)=p-1 (this is easy to notice), we get exactly what Fermat's Little Theorem says.

Preparing for a math contest?

Working through past problems on one idea at a time is one of the most effective ways to prepare. These are real problems from the AIME, the national math competitions for middle and high school students, each with a worked solution on LIVE by Po-Shen Loh.

Read · 1 min

Totient Function

Definition: For a positive integer nn, ϕ(n)\phi(n) is the number of positive integers which are less or equal to nn and relatively prime to nn.For example ϕ(10)=4\phi(10)=4 as there are 44 positive integers 1,3,7,91,3,7,9 which are less or equal to 1010 and relatively prime to 1010.

Theorem: Let nn be a positive integer. Then for all positive integer aa with gcd⁡(a,n)=1\gcd(a,n)=1 aϕ(n)≡1(modn)a^{\phi(n)}\equiv1\pmod n Proof: Let r1,r2,..........rϕ(n)r_1,r_2,..........r_{\phi(n)} be the positive integers that are less than nn and relatively prime to nn. Now we consider the numbers ar1,ar2,..............arϕ(n)ar_1,ar_2,..............ar_{\phi(n)}. We prove that {ar1,ar2,..............arϕ(n)}≡{r1,r2,..........rϕ(n)}(modn)\{ar_1,ar_2,..............ar_{\phi(n)}\} \equiv \{r_1,r_2,..........r_{\phi(n)}\}\pmod n in some order. As (a,n)=1(a,n)=1 and gcd⁡(ri,n)=1\gcd(r_i,n)=1, we must have gcd⁡(ari,n)=1\gcd(ar_i,n)=1 for 1≤i≤ϕ(n)1\leq i\leq \phi(n). Now if there exists distinct ii and jj s.t ari≡arj(modn)ar_i\equiv ar_j \pmod n then we can divide both sides by aa as (a,n)=1(a,n)=1 to get ri≡rj(modn)r_i\equiv r_j \pmod n which is impossible.

So all the numbers ar1,ar2.........arϕ(n)ar_{1},ar_{2}.........ar_{\phi(n)} are relatively prime to nn and leave different residues when divided by nn.

So {ar1,ar2,..............arϕ(n)}≡{r1,r2,..........rϕ(n)}(modn)\{ar_1,ar_2,..............ar_{\phi(n)}\} \equiv \{r_1,r_2,..........r_{\phi(n)}\}\pmod n in some order. Now we can deduce (ar1)(ar2).........(arϕ(n))≡r1r2.........rϕ(n)(modn)(ar_1)(ar_2).........(ar_{\phi(n)}) \equiv r_1r_2.........r_{\phi(n)}\pmod n Hence aϕ(n)r1r2..........rϕ(n)≡r1r2..........rϕ(n)(modn)a^{\phi(n)}r_1r_2..........r_{\phi(n)} \equiv r_1r_2..........r_{\phi(n)} \pmod n

Cancelling r1r2..........rϕ(n)r_1r_2..........r_{\phi(n)} from both sides, we finally get aϕ(n)≡1(modn)a^{\phi(n)}\equiv 1 \pmod n

Read · 1 min

Euler’s Phi function\textbf{Euler's Phi function}

Euler's Phi function,also known as totient function for a positive integer nn , denoted as φ(n)\varphi(n), is the number of positive integers less than nn which are coprime to nn.

As per Mathematical definition, φ(n)\varphi(n) the number of integers kk such that

(i) k<nk <n and \quad\quad\quad(ii) gcd(k,n)=1gcd(k,n)=1.

**1 is always counted in φ(n)\varphi(n) **.

∙\bullet\quadAs per this definition as we know that prime numbers are coprime to all integers less than itself, we conclude φ(p)=p−1\varphi(p)=p-1 when pp is a prime number.

∙\bullet\quadIf aa and bb are coprime, then φ(a×b)=φ(a)×φ(b)\varphi(a\times b)=\varphi(a) \times \varphi(b)

∙\bullet\quad φ\varphi of power of a prime, is φ(pk)=pk−1(p−1)\varphi(p^k)= p^{k-1}(p-1)

∙\bullet\quad To find the value of φ(n)\varphi(n), the formula is φ(n)=n∏p∣n(1−1p)\varphi(n) = n \prod_{p\mid n} \biggl( 1 - \dfrac{1}{p} \biggr)

Illustrative examples:-

(i)φ(14)=φ(2×7)=1×6=6(i)\quad\varphi(14)\\ = \varphi(2\times 7) \\ = 1\times 6 = \boxed{6}

..(ii)φ(72)=φ(9×8)=φ(9)×φ(8)=φ(32)×φ(23)=(31×2)×(22×1)=24.\\.\\ (ii) \quad \varphi(72) \\ = \varphi(9\times 8) \\ = \varphi(9) \times \varphi(8) \\ = \varphi(3^2) \times \varphi(2^3) \\ = (3^1\times 2) \times (2^2\times 1) = \boxed{24}

..(iii)φ(2014)=φ(2×19×53)=2014×(1−12)(1−119)(1−153)=2014×12×1819×5253=1×18×52(=φ(2)φ(19)φ(53))=936.\\.\\ (iii) \quad \varphi(2014)\\ = \varphi(2\times 19\times 53) \\= 2014\times \biggl(1 -\dfrac{1}{2}\biggr)\biggl(1 -\dfrac{1}{19}\biggr)\biggl(1 -\dfrac{1}{53}\biggr)\\ =2014\times \dfrac{1}{2} \times \dfrac{18}{19}\times \dfrac{52}{53}\\ = 1\times 18\times 52 \\ \bigl(=\varphi(2) \varphi(19)\varphi(53) \bigr) =\boxed{936}

Read · 1 min

Prove that φ(n)=∏pe∣∣npe−1(p−1).\varphi(n)=\prod_{p^e||n}p^{e-1}(p-1).

Type a concept, like “slope” or “photosynthesis”.

↑ ↓ to choose · Enter to openSearch explanations and problems