Maths Olympiad Prep

Library / /115 of 133

, 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 a2b2+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 p7p \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 1c<c+1p11 \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 a2cka^{2} \equiv c k and b2ck+kb^{2} \equiv c k + k modulo pp and therefore a2b2+k0(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 1c<c+1p11 \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 a2cka^{2} \equiv c k and b2ck+kb^{2} \equiv c k + k modulo pp and therefore a2b2+k0(modp)a^{2} - b^{2} + k \equiv 0 \pmod{p}.

Thus, this first step reduces to proving that among 1,2,,p11, 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,,p11, 2, \ldots, p-1 are quadratic nonresidues. So there exist at least p32\frac{p-3}{2} quadratic nonresidues among the p5p-5 consecutive numbers 5,6,,p15, 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 p3p-3 and p2p-2 are consecutive quadratic residues, or 1-1 is a quadratic residue, which means that p1(mod4)p \equiv 1 \pmod{4}, p13p \geq 13, and for each integer mm the integers mm and pmp-m are either both quadratic residues or both quadratic nonresidues. This means that there are p14\frac{p-1}{4} quadratic residues between 1,2,,p121, 2, \ldots, \frac{p-1}{2}.
If p12\frac{p-1}{2} is a quadratic residue then p12,p+12\frac{p-1}{2}, \frac{p+1}{2} are two consecutive quadratic residues.
If p12\frac{p-1}{2} is a quadratic nonresidue then there are p54\frac{p-5}{4} quadratic residues among the p92\frac{p-9}{2} consecutive numbers 4,5,,p324, 5, \ldots, \frac{p-3}{2}. But p92\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,,p1}=Q1N1Q2N2QkNk \{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 p1p-1 is a quadratic residue.
Let a{1,2,,p2}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 2k22k-2 or 2k12k-1 pairs (a,a+1)(a, a+1), with 1ap21 \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+a1p)=(1+a1p)\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,,p21, 2, \ldots, p-2, its inverse a1a^{-1} covers all the residues 1,2,,p21, 2, \ldots, p-2. Because there are exactly p12\frac{p-1}{2} quadratic nonresidues among the residues 2,3,,p12, 3, \ldots, p-1, we deduce that k=p+34k = \frac{p+3}{4} if p1(mod4)p \equiv 1 \pmod{4} and k=p+14k = \frac{p+1}{4} if p3(mod4)p \equiv 3 \pmod{4}.
Now, for 1ik1 \leq i \leq k, there are CardQi1\operatorname{Card} Q_{i} - 1 consecutive pairs of quadratic residues in QiQ_{i} and CardNi1\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,,p1}\{1, 2, \ldots, p-1\} is
i=1k(CardQi1)=Cardi=1kQik=p12k=p341, \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,,p1}\{1, 2, \ldots, p-1\} is
i=1k1(CardNi1)=Cardi=1k1Nik+1=p12k+1=p141\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 p1(mod4)p \equiv 1 \pmod{4} and
i=1k(CardNi1)=Cardi=1kNik=p12k=p141, \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 p3(mod4)p \equiv 3 \pmod{4}.

- Second Step: We prove it for n=pαn = p^{\alpha}, with p7p \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 a12b12+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α2b12+ka_{\alpha}^{2} - b_{1}^{2} + k. Consider the polynomial P(X)=X2b12+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α+1aα(modpα)a_{\alpha+1} \equiv a_{\alpha} \pmod{p^{\alpha}}, and therefore aα+1a1(modp)a_{\alpha+1} \equiv a_{1} \pmod{p}, such that P(aα+1)=aα+12b12+k0(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α2plαln = p_{1}^{\alpha_{1}} p_{2}^{\alpha_{2}} \cdots p_{l}^{\alpha_{l}}, where 7p1<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 ai2bi2+ka_{i}^{2} - b_{i}^{2} + k. From the Chinese remainder theorem, there exist two integers a,ba, b such that aai(modpiαi)a \equiv a_{i} \pmod{p_{i}^{\alpha_{i}}} and bbi(modpiαi)b \equiv b_{i} \pmod{p_{i}^{\alpha_{i}}}, for i=1,2,,li = 1, 2, \ldots, l. Therefore,
a2b2+kai2bi2+k0(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
a2b2+k0(modn). 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,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.