Recently, at an olympiad I came across a problem that left me stuck.
Let $n\ge 2$ be a natural number. For which smallest $n$ do there exist natural numbers $a_1,a_2,\dots,a_n$ such that
$$ \frac{\bigl(a_1+a_2+\cdots+a_n\bigr)^2-1}{a_1^2+a_2^2+\cdots+a_n^2} $$
is an integer?
I am not very well-versed in number theory, but here are the attempts I made:
The case $n=2$.
$$ \frac{(a+b)^2-1}{a^2+b^2}=\frac{2ab-1}{a^2+b^2}+1. $$
Since $2ab-1<a^2+b^2$, the fractional part $\dfrac{2ab-1}{a^2+b^2}$ cannot be a nonzero integer. (Also $2ab-1=0$ is impossible in natural numbers.) Hence the expression cannot be an integer for $n=2$.
A general estimate using the Cauchy–Schwarz / inequality of arithmetic and quadratic means:
$$ \bigl(a_1+\cdots+a_n\bigr)^2\le n\bigl(a_1^2+\cdots+a_n^2\bigr), $$
so
$$ \frac{\bigl(a_1+\cdots+a_n\bigr)^2-1}{a_1^2+\cdots+a_n^2}\le\frac{n\bigl(a_1^2+\cdots+a_n^2\bigr)-1}{a_1^2+\cdots+a_n^2}<n. $$
Thus any integer value of the expression must be strictly less than $n$.
A parity observation. Since
$$ a_1^2+\cdots+a_n^2\equiv\bigl(a_1+\cdots+a_n\bigr)^2\pmod 2, $$
if the sum of squares is even then $\bigl(a_1+\cdots+a_n\bigr)^2-1$ is odd; therefore $a_1^2+\cdots+a_n^2\equiv a_1+\cdots+a_n\equiv 1\pmod 2$. (I tried to use parity to restrict possible values, but didn’t reach a useful contradiction.)
Trying to reduce to a Diophantine equation:
$$ \bigl(a_1+\cdots+a_n-1\bigr)\bigl(a_1+\cdots+a_n+1\bigr)=k\cdot\bigl(a_1^2+\cdots+a_n^2\bigr), $$
but that didn’t lead anywhere productive.
The equal-values test: take $a_1=\cdots=a_n=m$. Then
$$ \frac{(nm)^2-1}{nm^2}=n-\frac{1}{nm^2}, $$
which is not an integer for $nm^2\ne1$.
I would be grateful for any ideas or hints. Thanks for your interest in the problem!