Maths Olympiad Prep

Library / /83 of 92

Number theory Difficulty 7.3 National olympiad, round 2 Prove it Iran

Sn={x2+ny2:x,yZ}. S_n = \{x^2 + n y^2 : x, y \in \mathbb{Z}\}.
Find all positive integers nn such that there exists an element of SnS_n which doesn't belong to any of the sets S1,S2,,Sn1S_1, S_2, \dots, S_{n-1}.

Solution

Answer. Any square-free number.

Since SjS_j doesn't exist for j1j \le 1, the statement is held for i=1i = 1. On the other hand if for an integer n>1n > 1 there exists a prime number pp, which p2np^2 \mid n, nn is not a valid number; Because for all integer numbers x,yx, y
x2+ny2=x2+(np2)(yp)2. x^2 + n y^2 = x^2 + \left(\frac{n}{p^2}\right) (y p)^2.
which means that
SnSnp2. S_n \subseteq S_{\frac{n}{p^2}}.
Now we prove that any square-free number has the property.

Lemma. If nn is a square-free positive integer then there are distinct odd prime numbers pkp_k for 1kn11 \le k \le n-1 where n-n is a quadratic residue modulo pkp_k but k-k is not. i.e. in Legendre symbol
(npk)=1,(kpk)=1.(1) \left(\frac{-n}{p_k}\right) = 1, \left(\frac{-k}{p_k}\right) = -1. \qquad (1)
Proof. Assume that n=q1qmn = q_1 \dots q_m, where qiq_i's are prime numbers. The claim is that at least one of the qiq_i's does not divide kk; otherwise if for 1im1 \le i \le m qiq_i divides kk then
nknk; n \mid k \longrightarrow n \le k;
Which is a contradiction.
Without loss of generality assume that qmq_m is one of the numbers that does not divide kk. So k=q1qr1tD2k = q_1 \dots q_r \ell_1 \dots \ell_t D^2 where 0r<m0 \le r < m.
If q1qm1tq_1 \dots q_m \ell_1 \dots \ell_t is an odd number then the numbers 4,q1,,qm,1,,t4, q_1, \dots, q_m, \ell_1, \dots, \ell_t are pairwise coprime so by applying the Chinese remainder theorem there exists an integer xx where
{x3(mod4)x1(modqi)1im1xu(modqm)x1(modi)1it. \begin{cases} x \equiv 3 \pmod{4} \\ x \equiv -1 \pmod{q_i} & 1 \le i \le m-1 \\ x \equiv u \pmod{q_m} \\ x \equiv -1 \pmod{\ell_i} & 1 \le i \le t. \end{cases}
Where uu is an integer number which u-u is a non-quadratic residue modulo qmq_m. Notice that thus qmq_m is an odd prime number such a number exists.
Because xx and 4q1qm1t4q_1 \dots q_m \ell_1 \dots \ell_t are coprime, By applying Dirichlet theorem,
there are infinitely many prime numbers of the form x+4q1qm1tdx + 4q_1 \dots q_m \ell_1 \dots \ell_t d.
Take one of those like pkp_k where pk>max(n,3)p_k > \max(n, 3).
By applying the law of quadratic reciprocity for odd prime numbers pkp_k and qjq_j
(pkqj)(qjpk)=(1)(pk1)(qj1)4.(2) \left(\frac{p_k}{q_j}\right) \left(\frac{q_j}{p_k}\right) = (-1)^{\frac{(p_k-1)(q_j-1)}{4}}. \qquad (2)
pi3(mod4)    pk121(mod2) p_i \equiv 3 \pmod{4} \implies \frac{p_k - 1}{2} \equiv 1 \pmod{2}
So
(1)(pk1)(qj1)2=(1)qj12. (-1)^{\frac{(p_k-1)(q_j-1)}{2}} = (-1)^{\frac{q_j-1}{2}}.
It's easy to check that
(1qj)=(1)qj12. \left(\frac{-1}{q_j}\right) = (-1)^{\frac{q_j-1}{2}}.
Also for 1jm11 \le j \le m-1
(pkqj)=(1qj). \left(\frac{p_k}{q_j}\right) = \left(\frac{-1}{q_j}\right).
Then according to (2)
(pkqj)(qjpk)=(1qj)(qjpk)=(1)(pk1)(qj1)4=(1)qj12=(1qj). \left(\frac{p_k}{q_j}\right) \left(\frac{q_j}{p_k}\right) = \left(\frac{-1}{q_j}\right) \left(\frac{q_j}{p_k}\right) = (-1)^{\frac{(p_k-1)(q_j-1)}{4}} = (-1)^{\frac{q_j-1}{2}} = \left(\frac{-1}{q_j}\right).
So
(qjpk)=1j:1jm1 \left(\frac{q_j}{p_k}\right) = 1 \quad \forall j: 1 \le j \le m-1
In the same way
(spk)=1s:1st. \left(\frac{\ell_s}{p_k}\right) = 1 \quad \forall s: 1 \le s \le t.
In addition
(pkqm)(qmpk)=(1)(pk1)(qm1)4=(1)qm12=(1qm). \left(\frac{p_k}{q_m}\right) \left(\frac{q_m}{p_k}\right) = (-1)^{\frac{(p_k-1)(q_m-1)}{4}} = (-1)^{\frac{q_m-1}{2}} = \left(\frac{-1}{q_m}\right).
Also
(pkqm)(qmpk)=(uqm)(qmpk)=(1×uqm)(qmpk)=(1qm)(qmpk) \left(\frac{p_k}{q_m}\right) \left(\frac{q_m}{p_k}\right) = \left(\frac{u}{q_m}\right) \left(\frac{q_m}{p_k}\right) = \left(\frac{-1 \times -u}{q_m}\right) \left(\frac{q_m}{p_k}\right) = -\left(\frac{-1}{q_m}\right) \left(\frac{q_m}{p_k}\right)
So
(1qm)(qmpk)=(1qm)(qmpk)=1 -\left(\frac{-1}{q_m}\right) \left(\frac{q_m}{p_k}\right) = \left(\frac{-1}{q_m}\right) \longrightarrow \left(\frac{q_m}{p_k}\right) = -1
Since the Legendre symbol is a completely multiplicative function of its top argument, then
(kpk)=(1pk)j=1r(qjpk)s=1t(spk)(D2pk)=(1pk)j=1rs=1t1=1,(npk)=(1pk)j=1m(qjpk)=(1pk)(qmpk)j=1m11=1×1=1. \begin{aligned} \left(\frac{-k}{p_k}\right) &= \left(\frac{-1}{p_k}\right) \prod_{j=1}^r \left(\frac{q_j}{p_k}\right) \prod_{s=1}^t \left(\frac{\ell_s}{p_k}\right) \left(\frac{D^2}{p_k}\right) = \left(\frac{-1}{p_k}\right) \prod_{j=1}^r \prod_{s=1}^t 1 = -1, \\ \left(\frac{-n}{p_k}\right) &= \left(\frac{-1}{p_k}\right) \prod_{j=1}^m \left(\frac{q_j}{p_k}\right) = \left(\frac{-1}{p_k}\right) \left(\frac{q_m}{p_k}\right) \prod_{j=1}^{m-1} 1 = -1 \times -1 = 1. \end{aligned}
So if nn and 1t\ell_1 \dots \ell_t are odd numbers, pkp_k has been found. If one is j\ell_j's is two; Assume that t=2\ell_t = 2 and take
{x7(mod8)x1(modqi)1im1xu(modqm)x1(modi)1it1. \left\{ \begin{array}{ll} x \equiv 7 \pmod{8} \\ x \equiv -1 \pmod{q_i} & 1 \le i \le m-1 \\ x \equiv u \pmod{q_m} \\ x \equiv -1 \pmod{\ell_i} & 1 \le i \le t-1. \end{array} \right.
Since qmq_m does not divide kk then it is an odd prime number and like before uu exists. Because xx and 8q1qm1t18q_1 \dots q_m \ell_1 \dots \ell_{t-1} are coprime, By applying Dirichlet theorem, there are infinitely many prime numbers of the form x+8q1qm1t1dx + 8q_1 \dots q_m \ell_1 \dots \ell_{t-1}d. Take one of those like pkp_k where pk>max(n,3)p_k > \max(n, 3). Thus
(2pk)=(1)pk218=1 \left(\frac{2}{p_k}\right) = (-1)^{\frac{p_k^2-1}{8}} = 1
So
(1pk)=1 \left(\frac{\ell_1}{p_k}\right) = 1
and the proof is the same as before.
Also if one of the q1,q2,,qm1q_1, q_2, \dots, q_{m-1} is two the proof is still as before.
Now assume that qm=2q_m = 2.
{x3(mod8)x1(modqi)1im1x1(modi)1it1. \left\{ \begin{array}{ll} x \equiv 3 \pmod{8} \\ x \equiv -1 \pmod{q_i} & 1 \le i \le m-1 \\ x \equiv -1 \pmod{\ell_i} & 1 \le i \le t-1. \end{array} \right.
In this case (By applying Dirichlet theorem we can take pkp_k similarly)
(2pk)=(1)pk218=1. \left(\frac{2}{p_k}\right) = (-1)^{\frac{p_k^2-1}{8}} = -1.
So
(qmpk)=1. \left(\frac{q_m}{p_k}\right) = -1.
And the proof of the lemma is done.

Now back to the main problem. Take p1,p2,,pn1p_1, p_2, \dots, p_{n-1} as lemma says.
Because n-n is a quadratic residue mod pip_i, there exists an integer number aa
such that
a2n(modpi)    a2+n0(modpi). a^2 \equiv -n \pmod{p_i} \implies a^2 + n \equiv 0 \pmod{p_i}.
Also
(a+pi)2+n(a2+n)=pi(2a+pi). (a+p_i)^2 + n - (a^2+n) = p_i(2a+p_i).
Since n0(modpi)n \neq 0 \pmod{p_i} and pip_i is odd then 2a2a is not divisible by pip_i and then 2a+pi2a+p_i is not divisible by pip_i. So if a2+na^2+n is divisible by pi2p_i^2 then (a+pi)2+n(a+p_i)^2+n is not and
(a+pi)2+n0(modpi). (a+p_i)^2+n \equiv 0 \pmod{p_i}.
So there exists an integer number xi{a,a+p}x_i \in \{a, a+p\} which
{(xi)2+n0(modpi)(xi)2+n≢0(modpi2). \begin{cases} (x_i)^2 + n \equiv 0 \pmod{p_i} \\ (x_i)^2 + n \not\equiv 0 \pmod{p_i^2}. \end{cases}
The numbers p12,p22,,pn12p_1^2, p_2^2, \dots, p_{n-1}^2 are pairwise coprime so by applying Chinese remainder theorem there exists an integer number xx such that
xxk(modpk2)j:2jl. x \equiv x_k \pmod{p_k^2} \quad \forall j: 2 \le j \le l.
Claim 1. The number x2+nx^2+n doesn't belong to any of the subsets S1,S2,,SnS_1, S_2, \dots, S_n.
Proof. If not, then there is an integer 1rn11 \le r \le n-1 which x2+nSrx^2+n \in S_r. Because 1rn11 \le r \le n-1 so take prp_r. Also there exists integer numbers u,vu, v such that
x2+n=u2+rv2.(3) x^2 + n = u^2 + r v^2. \qquad (3)
By the definition of prp_r
{xxr(modpr),(xr)2+n0(modpr),(xr)2+n≢0(modpr2).(4) \begin{cases} x \equiv x_r \pmod{p_r}, \\ (x_r)^2 + n \equiv 0 \pmod{p_r}, \\ (x_r)^2 + n \not\equiv 0 \pmod{p_r^2}. \end{cases} \qquad (4)
According to equation (3)
u2+rv20(modpr). u^2 + r v^2 \equiv 0 \pmod{p_r}.
Since r0(modpr)r \neq 0 \pmod{p_r}, then
u0(modpr)    v0(modpr). u \equiv 0 \pmod{p_r} \iff v \equiv 0 \pmod{p_r}.
So if one of them is divisible by pip_i then the another one is too and then the whole number u2+rv2u^2 + r v^2 will be divisible by pi2p_i^2 which contradicts with (4). Also
u2+rv20(modpr)    u2(r)v2(modpr). u^2 + r v^2 \equiv 0 \pmod{p_r} \implies u^2 \equiv (-r)v^2 \pmod{p_r}.
By Taking pr12\frac{p_r-1}{2} exponent of each side of the last equivalence
upr1(r)pr12vpr1(modpr).(5) u^{p_r-1} \equiv (-r)^{\frac{p_r-1}{2}} v^{p_r-1} \pmod{p_r}. \qquad (5)
Since u,v≢0(modpr)u, v \not\equiv 0 \pmod{p_r} by Fermat's little theorem
upr1vpr11(modpr) u^{p_r-1} \equiv v^{p_r-1} \equiv 1 \pmod{p_r}
And from (5)
(r)pr121(modpr). (-r)^{\frac{p_r-1}{2}} \equiv 1 \pmod{p_r}.
Let gg be the primitive root of the Zp\mathbb{Z}_p^* so there exists an integer number mm which
gmr(modpr). g^m \equiv -r \pmod{p_r}.
By Taking pr12\frac{p_r-1}{2} exponent of each side of the equivalence
gpr12(r)pr121(modpr). g^{\frac{p_r-1}{2}} \equiv (-r)^{\frac{p_r-1}{2}} \equiv 1 \pmod{p_r}.
Since the order of gg is pr1p_r - 1 in Zp\mathbb{Z}_p^*
pr1mpr12    2m. p_r - 1 \mid m \frac{p_r - 1}{2} \implies 2 \mid m.
So mm is an even number and then r-r is a quadratic residue which is a contradiction. This contradiction shows that our first assumption that x2+nx^2 + n belongs to SrS_r is wrong so nn has the property that is mentioned in the question. So all of the numbers with the property have been found. \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.