Euler's Theorem and Euler's Totient Function

April 12, 2026

Problem

Compute φ(36) and use Euler's theorem to find 7^100 mod 36. Show coprime counting.

Explanation

Euler's Totient Function φ(n)\varphi(n)

φ(n)\varphi(n) counts how many integers from 1 to nn are coprime to nn (share no common factor other than 1).

Step-by-step: Compute φ(36)\varphi(36)

Method 1 — Direct counting:

List integers 1 to 36 and check which are coprime to 36 (i.e., gcd(k,36)=1\gcd(k, 36) = 1):

36=22×3236 = 2^2 \times 3^2. So we exclude multiples of 2 and multiples of 3.

Coprime to 36: 1,5,7,11,13,17,19,23,25,29,31,351, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35. Count: 12.

Method 2 — Formula:

For n=p1a1×p2a2×n = p_1^{a_1} \times p_2^{a_2} \times \cdots:

φ(n)=n(11p1)(11p2)\varphi(n) = n \left(1 - \frac{1}{p_1}\right)\left(1 - \frac{1}{p_2}\right) \cdots

For 36=22×3236 = 2^2 \times 3^2:

φ(36)=36(112)(113)=36×12×23=36×13=12\varphi(36) = 36 \left(1 - \frac{1}{2}\right)\left(1 - \frac{1}{3}\right) = 36 \times \frac{1}{2} \times \frac{2}{3} = 36 \times \frac{1}{3} = 12

φ(36)=12\boxed{\varphi(36) = 12}

Euler's Theorem

If gcd(a,n)=1\gcd(a, n) = 1, then:

aφ(n)1(modn)a^{\varphi(n)} \equiv 1 \pmod{n}

This generalizes Fermat's little theorem (which is the special case where nn is prime, so φ(n)=n1\varphi(n) = n - 1).

Step-by-step: Find 7100mod367^{100} \mod 36

Step 1: gcd(7,36)=1\gcd(7, 36) = 1 ✓ and φ(36)=12\varphi(36) = 12.

Step 2: By Euler's theorem, 7121(mod36)7^{12} \equiv 1 \pmod{36}.

Step 3: 100=12×8+4100 = 12 \times 8 + 4, so 7100=(712)8×7418×7474(mod36)7^{100} = (7^{12})^8 \times 7^4 \equiv 1^8 \times 7^4 \equiv 7^4 \pmod{36}.

Step 4: 72=4913(mod36)7^2 = 49 \equiv 13 \pmod{36}. 74=132=1691694×36=169144=25(mod36)7^4 = 13^2 = 169 \equiv 169 - 4 \times 36 = 169 - 144 = 25 \pmod{36}.

710025(mod36)\boxed{7^{100} \equiv 25 \pmod{36}}

Special values of φ\varphi

  • φ(p)=p1\varphi(p) = p - 1 for prime pp
  • φ(pk)=pkpk1=pk1(p1)\varphi(p^k) = p^k - p^{k-1} = p^{k-1}(p-1)
  • φ\varphi is multiplicative: φ(mn)=φ(m)φ(n)\varphi(mn) = \varphi(m)\varphi(n) when gcd(m,n)=1\gcd(m,n) = 1

Try it in the visualization

Enter nn. The integers 1 to nn are displayed — those coprime to nn are highlighted. The count gives φ(n)\varphi(n). Then enter base aa and exponent ee to compute aemodna^e \mod n using Euler's theorem.

Interactive Visualization

Parameters

36.00
7.00
100.00
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day
Euler's Theorem and Euler's Totient Function | MathSpin