I was looking to the following problem of Spain's mathematics olympiad (for high-school students):
Let $n,p$ be positive integers with $p$ prime such that $1+np$ is a perfect square. Then $n+1$ is the sum of $p$ perfect squares.
Can you give me any hints to solve it. In principle, I've thought of double induction, formula for the sum of squares...
If $1 + np = m^2$, then $m \equiv \pm1 \pmod p$, hence $m = lp\pm 1$ for some $l$. Then $np = lp(lp\pm2)$, so $n = l^2p\pm2l$, so $$n+1 = \underbrace{l^2 + l^2 + \cdots + l^2}_{p-1 \text{times}.} + (l \pm 1)^2.$$