How to use it
- Type n, for example 720.
- Read φ(n), then the factorization and the steps. For n up to 60 the numbers coprime to n are listed too.
How it works
The tool factors n by trial division, then for each prime power pᵏ computes φ(pᵏ) = pᵏ⁻¹(p − 1) and multiplies the parts. This equals n·∏(1 − 1/p), which is also shown.
Worked example
n = 720 = 2⁴ × 3² × 5:
- φ(2⁴) = 2³ × (2 − 1) = 8
- φ(3²) = 3 × (3 − 1) = 6
- φ(5) = 4
- φ(720) = 8 × 6 × 4 = 192. Check with the product formula: 720 × ½ × ⅔ × ⅘ = 192.
Tips
- φ(n) is even for every n ≥ 3.
- To invert a number modulo n, see the extended Euclidean calculator; for factoring alone use the prime factorization tool.