Maths Olympiad Prep

Library / HMMT February /534 of 1302

HMMT February

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∥+⋯+∥n∥n=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,∥n∥n=(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=1m2∥n∥=∑k=1m−12(1+2+⋯+k)=∑k=1m−12(k+12)=2(m+13)=m3(m2−1)\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=m2−1n=m^{2}-1, ∥1∥+∥2∥+⋯+∥n∥n=m3\frac{\|1\|+\|2\|+\cdots+\|n\|}{n}=\frac{m}{3} so n=3002−1n=300^{2}-1 satisfies the condition. However, this does not prove that there are not smaller solutions for nn. Let N=3002−1N=300^{2}-1 and suppose that N−kN-k satisfies the condition. Then, we know that ∥N∥+∥N−1∥+⋯∥N−(k−1)∥k=100\frac{\|N\|+\|N-1\|+\cdots\|N-(k-1)\|}{k}=100. Since \|N-k\|=k+1 for k≤298k \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 3002−1−199=90000−200=300^{2}-1-199=90000-200= 89800.

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: Omni-MATH, licensed Apache-2.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.