
Problem 3. Let $n$ and $m$ be natural numbers such that $m+i=$ $a_{i} b_{i}^{2}$ for $i=1,2, \ldots, n$, where $a_{i}$ and $b_{i}$ are natural numbers and $a_{i}$ is not divisible by a square of a prime number. Find all $n$ for which there exists an $m$ such that $a_{1}+a_{2}+\cdots+a_{n}=12$.


Solution: It is clear that $n \leq 12$. Since $a_{i}=1$ if and only if $m+i$ is a perfect square, at most three of the numbers $a_{i}$ equal 1 (prove it!). It follows now from $a_{1}+a_{2}+\cdots+a_{n}=12$ that $n \leq 7$.

We show now that the numbers $a_{i}$ are pairwise distinct. Assume the contrary and let $m+i=a b_{i}^{2}$ and $m+j=a b_{j}^{2}$ for some $1 \leq i12$.

All possible values of $a_{i}$ are $1,2,3,5,6,7,10$ and 11. There are three possibilities for $n: n=2$ and $\left\{a_{1}, a_{2}\right\}=\{1,11\},\{2,10\},\{5,7\}$; $n=3$ and $\left\{a_{1}, a_{2}, a_{3}\right\}=\{1,5,6\},\{2,3,7\} ; n=4$ and $\left\{a_{1}, a_{2}, a_{3}, a_{4}\right\}=$ $\{1,2,3,6\}$. Suppose $n=4$ and $\left\{a_{1}, a_{2}, a_{3}, a_{4}\right\}=\{1,2,3,6\}$. Now $\left(6 b_{1} b_{2} b_{3} b_{4}\right)^{2}=(m+1)(m+2)(m+3)(m+4)=\left(m^{2}+5 m+5\right)^{2}-1$, which is impossible. Therefore $n=2$ or $n=3$.

If $n=3$ and $\left(a_{1}, a_{2}, a_{3}\right)=(1,5,6)$, then $m=3$ has the required property, and if $n=2$ and $\left(a_{1}, a_{2}\right)=(11,1)$, then $m=98$ has the required property. (It is not difficult to see that the remaining cases are not feasible.)
