Definition Zm∗=def{a∈Zm∣gcd(a,m)=1} ϕ(m)=∣Zm∗∣ general formula ϕ(m)=mp∣m∏(1−p1) when calulating by hand If m=p1k1p2k2⋯prkr is the prime factorization of m, then ϕ(m)=p1k1−1(p1−1)⋅p2k2−1(p2−1)⋯prkr−1(pr−1) So the rule is: Factor m into primes For each prime piki: keep piki−1 replace one pi by (pi−1) Multiply everything together Example m=18=2⋅32 ϕ(18)=21−1(2−1)⋅32−1(3−1)=1⋅1⋅3⋅2=6