Maths Olympiad Prep

Library / /12 of 16

, 2024

Number theory Difficulty 6.6 National olympiad Prove it Saudi Arabia

Find all odd integer nn such that the number of integers kk with 0<k<n40 < k < \frac{n}{4} and gcd(n,k)=1\gcd(n, k) = 1 is odd.

Solution

We claim that the only integers that work are prime powers pkp^k in which p5p \equiv 5 or 77 modulo 88. Let define ω,Ω\omega, \Omega as function from the set of odd integers to {0;1}\{0; 1\} by
ω(n)={0if n1,3(mod8)1if n5,7(mod8) \omega(n) = \begin{cases} 0 & \text{if } n \equiv 1,3 \pmod 8 \\ 1 & \text{if } n \equiv 5,7 \pmod 8 \end{cases}
and
Ω(n){k0<k<n/4,gcd(k,n)=1}(mod2). \Omega(n) \equiv |\{k\mid 0 < k < n/4, \gcd(k, n) = 1\}| \pmod 2.
Then we want to find nn such that Ω(n)=1\Omega(n) = 1. It is easy to verify
ω(ab)ω(a)+ω(b)(mod2)() \omega(ab) \equiv \omega(a) + \omega(b) \pmod 2 \qquad (\dagger)
Let n=p1a1p2a2pkakn = p_1^{a_1} p_2^{a_2} \dots p_k^{a_k} which p1,p2,,pkp_1, p_2, \dots, p_k are distinct primes and a1,a2,,aka_1, a_2, \dots, a_k are integers. Note that n=1n = 1 does not work so consider k1k \ge 1.

Lemma: Ω(n)ω(n)+1ikω(npi)+1i<jkω(npipj)++ω(np1p2pk)(mod2)\Omega(n) \equiv \omega(n) + \sum_{1 \le i \le k} \omega\left(\frac{n}{p_i}\right) + \sum_{1 \le i < j \le k} \omega\left(\frac{n}{p_i p_j}\right) + \dots + \omega\left(\frac{n}{p_1 p_2 \dots p_k}\right) \pmod 2.

Proof: the idea to proof this lemma is similar to prove the Euler totient function. It is easy to check that ω(n)\omega(n) is indeed the parity of {k0<k<n/4}=n4|\{k\mid 0 < k < n/4\}| = \lfloor \frac{n}{4} \rfloor. To remove numbers divisible by some pp, one can subtract from above the value
{pk0<k<n/(4p)}={k0<k<(n/p)/4}=ω(np). |\{pk\mid 0 < k < n/(4p)\}| = |\{k\mid 0 < k < (n/p)/4\}| = \omega\left(\frac{n}{p}\right).
But that removes numbers divisible by pqpq (for pqp \ne q) twice so we will add ω(pq)\omega(pq) then continue as the principle of inclusion and exclusion, we add until ω(np1p2pk)\omega\left(\frac{n}{p_1 p_2 \dots p_k}\right). Note that the formula should be added and subtracted alternatively but since we consider modulo 22 so all of the signs can be consider as plus. Back to the original problem, by applying the lemma and ()(\dagger), one can get
Ω(n)+1ikω(pi)+1i<jkω(pipj)++ω(p1p2pk)ω(n)+(1ikω(npi)+1ikω(pi))++(ω(np1p2pk)+ω(p1p2pk))(k0)ω(n)+(k1)ω(n)+(k2)ω(n)++(kk)ω(n)2kω(n)0(mod2). \begin{aligned} & \Omega(n) + \sum_{1 \le i \le k} \omega(p_i) + \sum_{1 \le i < j \le k} \omega(p_i p_j) + \dots + \omega(p_1 p_2 \dots p_k) \\ & \equiv \omega(n) + \left( \sum_{1 \le i \le k} \omega\left(\frac{n}{p_i}\right) + \sum_{1 \le i \le k} \omega(p_i) \right) + \dots + \left( \omega\left(\frac{n}{p_1 p_2 \dots p_k}\right) + \omega(p_1 p_2 \dots p_k) \right) \\ & \equiv \binom{k}{0} \omega(n) + \binom{k}{1} \omega(n) + \binom{k}{2} \omega(n) + \dots + \binom{k}{k} \omega(n) \\ & \equiv 2^k \omega(n) \equiv 0 \pmod 2. \end{aligned}
From this, one can conclude that
Ω(n)ω(1)+1ikω(pi)+1i<jkω(pipj)++ω(p1p2pk)=i=1k((k10)+(k11)++(k1k2))ω(pi)=2k1i=1nω(pi)=2k1ω(p1p2pk)(mod2). \begin{aligned} \Omega(n) &\equiv \omega(1) + \sum_{1 \le i \le k} \omega(p_i) + \sum_{1 \le i < j \le k} \omega(p_i p_j) + \dots + \omega(p_1 p_2 \dots p_k) \\ &= \sum_{i=1}^{k} \left( \binom{k-1}{0} + \binom{k-1}{1} + \dots + \binom{k-1}{k-2} \right) \omega(p_i) \\ &= 2^{k-1} \sum_{i=1}^{n} \omega(p_i) \\ &= 2^{k-1} \omega(p_1 p_2 \dots p_k) \pmod 2. \end{aligned}
Thus if k2k \ge 2 then Ω(n)=0\Omega(n) = 0 and if k=1k = 1, then n=pkn = p^k, in this case we can check that Ω(n)=ω(p)=1\Omega(n) = \omega(p) = 1 if and only if p5p \equiv 5 or 77 modulo 88. \square

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

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.