S={1,…,2022}. Find the probability that a randomly chosen n∈S satisfies gcd(n,2022)=1.
Solutions · 1
Official solution
2022=2×3×337. By inclusion-exclusion, numbers divisible by 2, 3 or 337: 1011+674+6−337−3−2+1=1350 (computed via the standard sieve, matching the source's total 1350).
\[P = \frac{2022-1350}{2022}=\frac{672}{2022}=\frac{112}{337}\]