QED
Number Theory · step 9 of 13

Euler’s totient φ(n) & Euler’s theorem

φ(n) counts the integers in 1…n coprime to n. It is multiplicative for coprime arguments and satisfies φ(p^k) = p^k − p^(k−1), so the factorisation of n gives φ(n) immediately. Euler’s theorem then generalises Fermat: a^φ(n) ≡ 1 (mod n) whenever gcd(a,n) = 1, which is what lets exponents be reduced for composite moduli.

Unlimited questions · marked criterion by criterion · no card needed

Method: how to approach it

The order below is what examiners expect to see, and each step carries its own marks.

  1. Factorise nEverything about φ comes from the prime factorisation.
  2. Apply φ(p^k) = p^k − p^(k−1)Equivalently p^(k−1)(p − 1). For a prime, φ(p) = p − 1.
  3. Multiply across coprime factorsφ(mn) = φ(m)φ(n) when gcd(m,n) = 1. This is why the formula works factor by factor.
  4. Reduce exponents mod φ(n)For gcd(a,n) = 1, a^e ≡ a^(e mod φ(n)) (mod n).

Worked example

Compute φ(36) and use it to find 5¹⁰⁰ mod 36.

  1. 36 = 2² × 3², so φ(36) = φ(4)φ(9) = (4−2)(9−3) = 2 × 6 = 12.
  2. gcd(5,36) = 1, so Euler applies: 5¹² ≡ 1 (mod 36).
  3. 100 = 12 × 8 + 4, so 5¹⁰⁰ ≡ 5⁴ (mod 36).
  4. 5⁴ = 625 = 36 × 17 + 13.

Answer. φ(36) = 12 and 5¹⁰⁰ ≡ 13 (mod 36).

Where marks get dropped

These are the specific errors that cost credit on euler’s totient φ(n) & euler’s theorem questions — QED's rubric penalises each of them separately.

Practise this until it is automatic

Unlimited fresh questions

QED generates new euler’s totient φ(n) & euler’s theorem problems on demand at warm-up, exam and challenge level, so you can drill this one skill until it stops costing you marks.

Marked like an examiner

Every answer is scored against a point-by-point rubric with partial credit, so you see exactly which step of the method broke down — not just a tick or a cross.

Answer in real notation

A one-tap symbol palette, a visual equation editor and a truth-table builder — or photograph your handwritten working and QED converts it to LaTeX.

Saved to your library

Every question you generate is kept and re-takeable as a timed exam, and your Number Theory mastery is tracked so you know when this is exam-ready.

Euler’s totient φ(n) & Euler’s theorem — frequently asked questions

What is the product formula for φ?

φ(n) = n·Π(1 − 1/p) over the distinct primes p dividing n. For 36 that is 36 × (1/2) × (2/3) = 12.

Why does RSA need φ?

Because the decryption exponent d satisfies ed ≡ 1 (mod φ(n)), so encryption and decryption compose to the identity by Euler’s theorem.

Is φ(n) always even?

For n > 2, yes. Coprime residues pair up as a and n − a, and they are distinct for n > 2.

The rest of Number Theory

Divisibility, primes, gcd, modular arithmetic. Each subtopic below has its own method, worked example and mark-losing traps.

Ready to make euler’s totient φ(n) & euler’s theorem exam-proof?

Generate your first questions free — no card, no setup, no personal data stored. Practise until the method is second nature.

Start practising free →