Phifunktsioon
Phifunktsioon, also called Euler’s totient function, is a number-theoretic function denoted φ(n) that counts the positive integers up to n that are coprime to n. Formally, φ(n) = |{k : 1 ≤ k ≤ n, gcd(k, n) = 1}|. It is defined for positive integers n, with φ(1) = 1.
Key properties include multiplicativity: φ(ab) = φ(a)φ(b) whenever gcd(a, b) = 1. For prime powers, φ(p^k) = p^k − p^{k−1}
Examples help illustrate: φ(36) = 12 since 36 = 2^2·3^2 and φ(36) = 36(1 − 1/2)(1 − 1/3) = 12; φ(10) = 4
Applications of the phifunktsioon include counting coprime residues modulo n and cryptographic uses such as RSA-style