Maths Olympiad Prep

Library / /459 of 860

Number theory Difficulty 5.2 AIME, harder Find the answer

Given a positive integer kk, let \|k\| denote the absolute difference between kk and the nearest perfect square. For example, \|13\|=3 since the nearest perfect square to 13 is 16. Compute the smallest positive integer nn such that 1+2++nn=100\frac{\|1\|+\|2\|+\cdots+\|n\|}{n}=100.

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Solution

Note that from n=m2n=m^{2} to n=(m+1)2,nn=(m+1)^{2},\|n\| increases from 0 to a peak of mm (which is repeated twice), and then goes back down to 0. Therefore n=1m2n=k=1m12(1+2++k)=k=1m12(k+12)=2(m+13)=m3(m21)\sum_{n=1}^{m^{2}}\|n\|=\sum_{k=1}^{m-1} 2(1+2+\cdots+k)=\sum_{k=1}^{m-1} 2\binom{k+1}{2}=2\binom{m+1}{3}=\frac{m}{3}\left(m^{2}-1\right). In particular, if n=m21n=m^{2}-1, 1+2++nn=m3\frac{\|1\|+\|2\|+\cdots+\|n\|}{n}=\frac{m}{3} so n=30021n=300^{2}-1 satisfies the condition. However, this does not prove that there are not smaller solutions for nn. Let N=30021N=300^{2}-1 and suppose that NkN-k satisfies the condition. Then, we know that N+N1+N(k1)k=100\frac{\|N\|+\|N-1\|+\cdots\|N-(k-1)\|}{k}=100. Since \|N-k\|=k+1 for k298k \leq 298, one can show that k=199k=199 works. By looking at further terms, one can convince oneself that no larger value of kk works. Thus, the answer is 30021199=90000200=300^{2}-1-199=90000-200= 89800.

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