Maths Olympiad Prep

Library / /502 of 520

Number theory Difficulty 7.6 National olympiad, round 2 Prove it

Let n0n \geq 0 be an integer. A sequence a0,a1,a2,a_{0}, a_{1}, a_{2}, \ldots of integers is defined as follows: a0=na_{0}=n and for k1k \geq 1, aka_{k} is the smallest integer greater than ak1a_{k-1} such that ak+ak1a_{k}+a_{k-1} is the square of an integer. Prove that there are exactly 2n\lfloor\sqrt{2 n}\rfloor positive integers that cannot be written in the form akaa_{k}-a_{\ell} with k>0k>\ell \geq 0.

Solution

Let m=2nm=\lfloor\sqrt{2 n}\rfloor. We first prove that the sequence of squares a0+a1,a1+a2a_{0}+a_{1}, a_{1}+a_{2}, ... is exactly the sequence (m+1)2,(m+2)2,(m+1)^{2},(m+2)^{2}, \ldots. Then we show that the differences aiai1a_{i}-a_{i-1} form a sequence of consecutive even numbers and a sequence of consecutive odd numbers. With this, we can then prove the required statement.
Note that a0+a1a_{0}+a_{1} is the smallest square greater than 2n2 n. Therefore, a0+a1=(m+1)2a_{0}+a_{1}=(m+1)^{2}. We now prove by induction on ii that ai1+ai=(m+i)2a_{i-1}+a_{i}=(m+i)^{2}. For i=1i=1, we have just proven this. Suppose that aj1+aj=(m+j)2a_{j-1}+a_{j}=(m+j)^{2}. This means that aj1(m+j1)22a_{j-1} \geq \frac{(m+j-1)^{2}}{2} (otherwise, aja_{j} could have been chosen such that aj1+aj=(m+j1)2a_{j-1}+a_{j}=(m+j-1)^{2}) and thus

ENV0 \begin{aligned} a_{j} & =(m+j)^{2}-a_{j-1} \\ & \leq(m+j)^{2}-\frac{(m+j-1)^{2}}{2} \\ & =\frac{2 m^{2}+4 m j+2 j^{2}-\left(m^{2}+2 m j+j^{2}+1-2 m-2 j\right)}{2} \\ & =\frac{m^{2}+2 m j+j^{2}-1+2 m+2 j}{2} \\ & a_{j-1}+a_{j}=(m+j)^{2}, so a_{j}+a_{j+1}=(m+j+1)^{2}. This completes the induction. Define now b_{i}=a_{i}-a_{i-1} for all i \geq 1. Then we have \begin{aligned} b_{i+2}-b_{i} & =a_{i+2}-a_{i+1}-a_{i}+a_{i-1} \\ & =\left(a_{i+2}+a_{i+1}\right)+\left(a_{i}+a_{i-1}\right)-2\left(a_{i+1}+a_{i}\right) \\ & =(m+i+2)^{2}+(m+i)^{2}-2(m+i+1)^{2} \\ & =(m+i)^{2}+4(m+i)+4+(m+i)^{2}-2(m+i)^{2}-4(m+i)-2 \\ & =2 \end{aligned}

for all i1i \geq 1. We now see that

(b1,b3,b5,)=(b1,b1+2,b1+4,),(b2,b4,b6,)=(b2,b2+2,b2+4,) \left(b_{1}, b_{3}, b_{5}, \ldots\right)=\left(b_{1}, b_{1}+2, b_{1}+4, \ldots\right), \quad\left(b_{2}, b_{4}, b_{6}, \ldots\right)=\left(b_{2}, b_{2}+2, b_{2}+4, \ldots\right)

We have b1+b2=(a2a1)+(a1a0)=(a2+a1)(a1+a0)=(m+2)2(m+1)2=2m+3b_{1}+b_{2}=\left(a_{2}-a_{1}\right)+\left(a_{1}-a_{0}\right)=\left(a_{2}+a_{1}\right)-\left(a_{1}+a_{0}\right)=(m+2)^{2}-(m+1)^{2}=2 m+3. In particular, b1b_{1} and b2b_{2} have different parities. Now, at least all numbers with the same parity as b1b_{1} and at least as large as b1b_{1} can be written as akak1a_{k}-a_{k-1} for some kk. The same holds for the numbers with the same parity as b2b_{2} and at least as large as b2b_{2}. All numbers of the form akaa_{k}-a_{\ell} with k+2k \geq \ell+2 are at least as large as bk+bk1b1+b2b_{k}+b_{k-1} \geq b_{1}+b_{2} and thus larger than b1b_{1} and larger than b2b_{2}. In this way, we can no longer generate new numbers. The numbers that cannot be written as akaa_{k}-a_{\ell} with k>0k>\ell \geq 0 are thus exactly the numbers with the same parity as b1b_{1} and smaller than b1b_{1} and the numbers with the same parity as b2b_{2} and smaller than b2b_{2}. This is a total of

b112+b212 \left\lfloor\frac{b_{1}-1}{2}\right\rfloor+\left\lfloor\frac{b_{2}-1}{2}\right\rfloor

numbers, where within the brackets of the floor function, exactly one of the two times is an integer. We can thus write this as

b112+b21212=b1+b232=2m2=m \frac{b_{1}-1}{2}+\frac{b_{2}-1}{2}-\frac{1}{2}=\frac{b_{1}+b_{2}-3}{2}=\frac{2 m}{2}=m \text {. }

There are thus exactly m=2nm=\lfloor\sqrt{2 n}\rfloor positive integers that cannot be written in the required form.

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: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic and difficulty added by this site.