Cryptography, Security, Math, Encryption, Data Security.
positive integers less than n that are not relatively prime to n is q (multiples of p) + p (multiples of q) — 1 (common multiples). The count of positive integers less than n that are relatively prime to n is then n — the count of those that aren’t. Substituting the values, we get: n — (p + q — 1)