EULER'S TOTIENT FUNCTION AND EULER'S THEOREM

phi(n) = count of integers 1..n that are coprime with n (gcd(i, n) = 1).

Formulas:
    phi(p) = p - 1                    (p prime)
    phi(p*q) = (p-1)*(q-1)            (p, q distinct primes)
    Euler's theorem: a^phi(n) = 1 (mod n)   if gcd(a, n) = 1

(Fermat's theorem is the special case when n is prime. RSA uses phi(n).)

Steps:
1. For every i from 1 to n find gcd(i, n) with the Euclid method.
2. Count the i where gcd is 1, this count is phi(n).
3. phi(7)=6, phi(10)=4, phi(12)=4, phi(35)=24.
4. Check theorem: 3^24 mod 35 = 1.
