Maths Olympiad Prep

Library / NMO Selection Tests for BMO and IMO /20 of 47

NMO Selection Tests for BMO and IMO

Number theory Difficulty 8.0 Shortlist Prove it Romania

Let nn be a positive integer, and let AnA_n, respectively BnB_n, be the set of non-negative integers k<nk < n such that the number of distinct prime factors of gcd⁡(k,n)\gcd(k, n) is even, respectively odd. Show that ∣An∣=∣Bn∣|A_n| = |B_n| if nn is even, and ∣An∣>∣Bn∣|A_n| > |B_n| if nn is odd.

Solution

Since gcd⁡(k,n)\gcd(k, n) depends only upon the residue class of kk modulo nn, ∣An∣−∣Bn∣=∑k(−1)s(k,n)|A_n| - |B_n| = \sum_k (-1)^{s(k,n)}, where s(k,n)s(k, n) is the number of distinct prime factors of gcd⁡(k,n)\gcd(k, n), and kk ranges over any complete residue system modulo nn.
We shall prove that the above sum equals n∏p∣n(1−2/p)n \prod_{p|n} (1 - 2/p), pp prime, whence the conclusion; the latter is precisely the number of positive integers k<nk < n such that kk and k+1k+1 are both coprime to nn.
In the above notation, let e(k,n)=(−1)s(k,n)e(k, n) = (-1)^{s(k,n)} and let f(n)=∑ke(k,n)f(n) = \sum_k e(k, n). We show that ff is a numerical multiplicative function — that is, if n1n_1 and n2n_2 are coprime positive integers, then f(n1n2)=f(n1)f(n2)f(n_1n_2) = f(n_1)f(n_2).
If n1,n2n_1, n_2 are coprime positive integers, then e(k,n1n2)=e(k,n1)e(k,n2)e(k, n_1n_2) = e(k, n_1)e(k, n_2). Further, if kik_i ranges once over a complete residue system modulo nin_i, i=1,2i = 1, 2, then k=k1n2+k2n1k = k_1n_2 + k_2n_1 ranges once over a complete residue system modulo n1n2n_1n_2, and e(k,ni)=e(ki,ni)e(k, n_i) = e(k_i, n_i), i=1,2i = 1, 2. Hence e(k,n1n2)=e(k,n1)e(k,n2)=e(k1,n1)e(k2,n2)e(k, n_1n_2) = e(k, n_1)e(k, n_2) = e(k_1, n_1)e(k_2, n_2), and
f(n1n2)=∑ke(k,n1n2)=∑k1∑k2e(k1,n1)e(k2,n2)=f(n1)f(n2). f(n_1n_2) = \sum_k e(k, n_1n_2) = \sum_{k_1} \sum_{k_2} e(k_1, n_1)e(k_2, n_2) = f(n_1)f(n_2).
Finally, if pp is a prime, and mm is a positive integer, then f(pm)f(p^m) equals the number of kk's coprime to pp, which is pm−pm−1p^m - p^{m-1}, minus the number of kk's divisible by pp, which is pm−1p^{m-1}, so f(pm)=pm(1−2/p)f(p^m) = p^m(1 - 2/p). This ends the proof.

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.