Maths Olympiad Prep

Library / Saudi Arabian Mathematical Competitions /341 of 395

Saudi Arabian Mathematical Competitions, 2015

Number theory Difficulty 6.8 National Olympiad Prove it Saudi Arabia

Let nn and kk be two positive integers. Prove that if nn is relatively prime with 3030, then there exist two integers aa and bb, each relatively prime with nn, such that a2−b2+kn\frac{a^{2}-b^{2}+k}{n} is an integer.

Solution

We will proceed by steps.

- First Step: We prove it for n=pn = p a prime number, with p≥7p \geq 7:

If pp divides kk then a=b=1a = b = 1 satisfy the condition. If pp does not divide kk then let us consider two cases:

a. If kk is a quadratic residue modulo pp, and cc and c+1c+1 are two consecutive quadratic residues modulo pp such that 1≤c<c+1≤p−11 \leq c < c+1 \leq p-1, then both kck c and kc+kk c + k are quadratic residues relatively prime with pp. This means that there exist aa and bb, each relatively prime with pp, such that a2≡cka^{2} \equiv c k and b2≡ck+kb^{2} \equiv c k + k modulo pp and therefore a2−b2+k≡0(modp)a^{2} - b^{2} + k \equiv 0 \pmod{p}.

b. If kk is a quadratic nonresidue modulo pp, and cc and c+1c+1 are two consecutive quadratic nonresidues modulo pp such that 1≤c<c+1≤p−11 \leq c < c+1 \leq p-1, then both kck c and kc+kk c + k are quadratic residues relatively prime with pp. This means that there exist aa and bb, each relatively prime with pp, such that a2≡cka^{2} \equiv c k and b2≡ck+kb^{2} \equiv c k + k modulo pp and therefore a2−b2+k≡0(modp)a^{2} - b^{2} + k \equiv 0 \pmod{p}.

Thus, this first step reduces to proving that among 1,2,…,p−11, 2, \ldots, p-1 there are two consecutive quadratic residues and two consecutive quadratic nonresidues modulo pp. We will prove this fact in two different ways:

First way. Notice that both 11 and 44 are quadratic residues.
If 22 or 33 is a quadratic residue then there exists at least two consecutive quadratic residues among 1,2,3,41, 2, 3, 4. But exactly half of the numbers 1,2,…,p−11, 2, \ldots, p-1 are quadratic nonresidues. So there exist at least p−32\frac{p-3}{2} quadratic nonresidues among the p−5p-5 consecutive numbers 5,6,…,p−15, 6, \ldots, p-1. So, by a pigeonhole principle, at least two of them must be consecutive.
If 22 and 33 are consecutive quadratic nonresidues, we have two possibilities: Either −1-1 is a quadratic nonresidue and in this case p−3p-3 and p−2p-2 are consecutive quadratic residues, or −1-1 is a quadratic residue, which means that p≡1(mod4)p \equiv 1 \pmod{4}, p≥13p \geq 13, and for each integer mm the integers mm and p−mp-m are either both quadratic residues or both quadratic nonresidues. This means that there are p−14\frac{p-1}{4} quadratic residues between 1,2,…,p−121, 2, \ldots, \frac{p-1}{2}.
If p−12\frac{p-1}{2} is a quadratic residue then p−12,p+12\frac{p-1}{2}, \frac{p+1}{2} are two consecutive quadratic residues.
If p−12\frac{p-1}{2} is a quadratic nonresidue then there are p−54\frac{p-5}{4} quadratic residues among the p−92\frac{p-9}{2} consecutive numbers 4,5,…,p−324, 5, \ldots, \frac{p-3}{2}. But p−92\frac{p-9}{2} is an even number. So, by a pigeonhole principle, at least two of the quadratic residues must be consecutive.

Second way. In this second way we will compute the exact number of consecutive pairs of quadratic residues and the exact number of consecutive pairs of quadratic nonresidues.
Consider the partition
{1,2,…,p−1}=Q1∪N1∪Q2∪N2∪⋯∪Qk∪Nk \{1, 2, \ldots, p-1\} = Q_{1} \cup N_{1} \cup Q_{2} \cup N_{2} \cup \cdots \cup Q_{k} \cup N_{k}
where Q1Q_{1} is the set of all the first consecutive quadratic residues, possibly reduced to the singleton {1}\{1\} when 22 is a quadratic nonresidue, N1N_{1} is the set of all the first consecutive quadratic nonresidues, possibly reduced to a singleton, Q2Q_{2} is the set of all the first consecutive quadratic residues after the elements of N1N_{1}, and so on... Notice that NkN_{k} is the only possibly empty set when p−1p-1 is a quadratic residue.
Let a∈{1,2,…,p−2}a \in \{1, 2, \ldots, p-2\}. Notice that (ap)(a+1p)=1\left(\frac{a}{p}\right)\left(\frac{a+1}{p}\right) = 1 if and only if a,a+1a, a+1 are both quadratic residues or both quadratic nonresidues, where (ap)\left(\frac{a}{p}\right) is the Legendre symbol. This means that (ap)(a+1p)=−1\left(\frac{a}{p}\right)\left(\frac{a+1}{p}\right) = -1 if and only if a,a+1a, a+1 do not belong to the same subset of the partition. This means that there are either 2k−22k-2 or 2k−12k-1 pairs (a,a+1)(a, a+1), with 1≤a≤p−21 \leq a \leq p-2 such that (ap)(a+1p)=−1\left(\frac{a}{p}\right)\left(\frac{a+1}{p}\right) = -1, depending on whether NkN_{k} is empty or not. But (ap)(a+1p)=(ap)2(1+a−1p)=(1+a−1p)\left(\frac{a}{p}\right)\left(\frac{a+1}{p}\right) = \left(\frac{a}{p}\right)^{2}\left(\frac{1+a^{-1}}{p}\right) = \left(\frac{1+a^{-1}}{p}\right). But when aa covers all the residues 1,2,…,p−21, 2, \ldots, p-2, its inverse a−1a^{-1} covers all the residues 1,2,…,p−21, 2, \ldots, p-2. Because there are exactly p−12\frac{p-1}{2} quadratic nonresidues among the residues 2,3,…,p−12, 3, \ldots, p-1, we deduce that k=p+34k = \frac{p+3}{4} if p≡1(mod4)p \equiv 1 \pmod{4} and k=p+14k = \frac{p+1}{4} if p≡3(mod4)p \equiv 3 \pmod{4}.
Now, for 1≤i≤k1 \leq i \leq k, there are Card⁡Qi−1\operatorname{Card} Q_{i} - 1 consecutive pairs of quadratic residues in QiQ_{i} and Card⁡Ni−1\operatorname{Card} N_{i} - 1 consecutive pairs of quadratic nonresidues in NiN_{i}. We deduce that the total number of consecutive pairs of quadratic residues in {1,2,…,p−1}\{1, 2, \ldots, p-1\} is
∑i=1k(Card⁡Qi−1)=Card⁡⋃i=1kQi−k=p−12−k=⌊p−34⌋≥1, \sum_{i=1}^{k} (\operatorname{Card} Q_{i} - 1) = \operatorname{Card} \bigcup_{i=1}^{k} Q_{i} - k = \frac{p-1}{2} - k = \left\lfloor \frac{p-3}{4} \right\rfloor \geq 1,
and the total number of consecutive pairs of quadratic nonresidues in {1,2,…,p−1}\{1, 2, \ldots, p-1\} is
∑i=1k−1(Card⁡Ni−1)=Card⁡⋃i=1k−1Ni−k+1=p−12−k+1=⌊p−14⌋≥1\sum_{i=1}^{k-1} (\operatorname{Card} N_{i} - 1) = \operatorname{Card} \bigcup_{i=1}^{k-1} N_{i} - k + 1 = \frac{p-1}{2} - k + 1 = \left\lfloor \frac{p-1}{4} \right\rfloor \geq 1, if p≡1(mod4)p \equiv 1 \pmod{4} and
∑i=1k(Card⁡Ni−1)=Card⁡⋃i=1kNi−k=p−12−k=⌊p−14⌋≥1, \sum_{i=1}^{k} (\operatorname{Card} N_{i} - 1) = \operatorname{Card} \bigcup_{i=1}^{k} N_{i} - k = \frac{p-1}{2} - k = \left\lfloor \frac{p-1}{4} \right\rfloor \geq 1,
if p≡3(mod4)p \equiv 3 \pmod{4}.

- Second Step: We prove it for n=pαn = p^{\alpha}, with p≥7p \geq 7 is a prime number and α≥1\alpha \geq 1. We proceed by induction on α\alpha:

For α=1\alpha = 1, we have already proved in the first step that there exist two integers a1,b1a_{1}, b_{1}, each relatively prime with pp, such that pp divides a12−b12+ka_{1}^{2} - b_{1}^{2} + k.
For α≥1\alpha \geq 1, assume that there exists an integer aα≡a1(modp)a_{\alpha} \equiv a_{1} \pmod{p} such that pαp^{\alpha} divides aα2−b12+ka_{\alpha}^{2} - b_{1}^{2} + k. Consider the polynomial P(X)=X2−b12+kP(X) = X^{2} - b_{1}^{2} + k. Because P(aα)≡0(modpα)P(a_{\alpha}) \equiv 0 \pmod{p^{\alpha}} and P′(aα)=2aα≡2a1≢0(modp)P'(a_{\alpha}) = 2 a_{\alpha} \equiv 2 a_{1} \not\equiv 0 \pmod{p}, there exists, from Hensel's lemma, an integer aα+1≡aα(modpα)a_{\alpha+1} \equiv a_{\alpha} \pmod{p^{\alpha}}, and therefore aα+1≡a1(modp)a_{\alpha+1} \equiv a_{1} \pmod{p}, such that P(aα+1)=aα+12−b12+k≡0(modpα+1)P(a_{\alpha+1}) = a_{\alpha+1}^{2} - b_{1}^{2} + k \equiv 0 \pmod{p^{\alpha+1}}. This proves the induction.

- Last Step: We prove the general case when n=p1α1p2α2⋯plαln = p_{1}^{\alpha_{1}} p_{2}^{\alpha_{2}} \cdots p_{l}^{\alpha_{l}}, where 7≤p1<p2<⋯<pl7 \leq p_{1} < p_{2} < \cdots < p_{l} are prime numbers. We know from the second step, that for each i=1,2,…,li = 1, 2, \ldots, l, there exist two integers ai,bia_{i}, b_{i}, relatively prime with pip_{i}, such that piαip_{i}^{\alpha_{i}} divides ai2−bi2+ka_{i}^{2} - b_{i}^{2} + k. From the Chinese remainder theorem, there exist two integers a,ba, b such that a≡ai(modpiαi)a \equiv a_{i} \pmod{p_{i}^{\alpha_{i}}} and b≡bi(modpiαi)b \equiv b_{i} \pmod{p_{i}^{\alpha_{i}}}, for i=1,2,…,li = 1, 2, \ldots, l. Therefore,
a2−b2+k≡ai2−bi2+k≡0(modpiαi) a^{2} - b^{2} + k \equiv a_{i}^{2} - b_{i}^{2} + k \equiv 0 \quad \pmod{p_{i}^{\alpha_{i}}}
for all i=1,2,…,li = 1, 2, \ldots, l, and hence
a2−b2+k≡0( mod n). a^{2} - b^{2} + k \equiv 0 \quad (\bmod n).
On the other hand,
gcd⁡(n,a)=∏i=0lgcd⁡(piαi,ai)=1 and gcd⁡(n,b)=∏i=0lgcd⁡(piαi,bi)=1. \gcd(n, a) = \prod_{i=0}^{l} \gcd(p_{i}^{\alpha_{i}}, a_{i}) = 1 \text{ and } \gcd(n, b) = \prod_{i=0}^{l} \gcd(p_{i}^{\alpha_{i}}, b_{i}) = 1.
This completes 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.