It's a parody of the title of Martin ERICKSON's book "Aha! Solutions"
The Problems Given at the Dam for JBMO in North Macedonia fell into my hands. I said I'd try my hand at Problem 1.
"1. Let $n>1$ be a natural number and $m>2$ a divisor of $2n$. Prove that
the number $n^2$ can be written as the sum of $m$ nonzero perfect squares."
I have no idea how to solve this, so for now I'm just showing a few
EXAMPLES CiP
a) $n=2$ : $2<m \mid 4\;\;\Rightarrow\;\;m=4$. We have the equation
$2^2=1+1+1+1$
b) $n=3$ : $2<m \mid 6\;\;\Rightarrow\;\;m=3$ or $m=6$. We have the equations
$3^2=1+4+4$
$3^2=1+1+1+1+1+4$
c) $n=4$ : $2<m \mid 8\;\;\Rightarrow\;\;m=4$ or $m=8$. We have the equations
$4^2=4+4+4+4$
$4^2=1+1+1+1+1+1+1+9$
Let's hope that inspiration will help me solve the problem.
Edited Friday 06 June The following Lemma, which I will now formulate only as a Conjecture, would be helpful:
Lemma CiP (Conjecture) Whatever the prime number $p>2$, the
number $p^2$ can be written as the sum of $p$ squares.
So we have an equation like this
$$p^2=a_1^2+a_2^2+\dots +a_p^2=\sum_{i=1}^pa_i^2 \tag{P}$$
Examples:
$3^2=\underset{3-terms}{\underbrace{1+4+4}}$
$5^2=\underset{5-terms}{\underbrace{4+4+4+9}}$
$7^2=\underset{7-terms}{\underbrace{1+1+4+9+9+9+16}}$
For the following example we proceed by trial and error:
$11^2=\underset{4-terms}{\underbrace{5+16+36+64}}\;\overset{we\;replace\; 16\; with\; a}{\underset{sum\;of\;several\;terms}{=}}\;\underset{7-terms}{\underbrace{5+4+4+4+4+36+64}}=$
and now if we replace the term $5$ with the sum $1+1+1+1+1$ we are lucky to obtain the desired result, so
$11^2=\underset{11-terms}{\underbrace{1+1+1+1+1+4+4+4+4+36+64}}$
Until we find a proof for the Lemma, let us observe that if for two prime numbers $p>2$ and $q>2$ we have decompositions (P) and
$$q^2=\sum_{j=1}^qb_j^2$$
then because
$$\left ( \sum_{i=1}^pa_i^2\right )\cdot \left (\sum_{j=1}^qb_j^2 \right )=\sum_{i,j=1}^{i=p,j=q}a_i^2b_j^2$$
we obtain a sum of $p\cdot q$ squares
$$p^2\cdot q^2=\sum_{i,j=1}^{i=p,j=q}(a_i\cdot b_j)^2 \tag{PQ}$$
<end Edit 06 June>
Weekend Edition (There are no days off in Mathematics. When you are struggling with a problem, you are constantly thinking about it.)
But what if the property in yesterday's Lemma holds for any number $n>2$ ?
Also by trying, as for number $121$ , I obtained the following equations:
$4^2=\underset{4-terms}{\underbrace{4+4+4+4}}$
$6^2=\underset{6-terms}{\underbrace{1+1+1+4+4+25}}$
$8^2=\underset{8-terms}{\underbrace{1+1+1+1+1+1+9+49}}$
$9^2=\underset{9-terms}{\underbrace{1+1+1+1+1+4+4+4+64}}$
Ugh!, no pattern is visible. Worse, if we start from equation for $3^2=1+4+4$ and square it (or rather multiply it by itself),
$3^2 \cdot 3^2=(1+4+4)\cdot (1+4+4)=\dots $ (the $3\times 3=9$ terms obtained by multiplication are all squares)
we find an equation for $9^2$ that differs from what I obtained:
$9^2=\underset{9-terms}{\underbrace{1+4+4+4+4+16+16+16+16}}$
So, we don't have unique writings for the representations we're looking for. Complicated stuff...
<end Weekend Edition>
I couldn't be patient anymore and I consulted the solution to the problem. As expected, the problem should be quite simple. I'm saved !
You can also consult the solution from where I got the problem statement.
As a consolation for how much I've been struggling these days, the statement that I considered above as a Lemma is true. In fact, the following are true:
(a) For any number $n\geqslant 3$, the number $n^2$ can be written as a sum
of $n$ nonzero perfect squares.
(b) For any number $n\geqslant 2$, the number $n^2$ can be written as a sum
of $2\cdot n$ nonzero perfect squares.
To my shame, these statements are almost trivial. If you only showed them, you would get 2 points on the solution scale. For just one, you would get nothing.
Proof of (a) : We have that
$n^2=(n^2-4\cdot n +4)+4\cdot n-4=(n-2)^2+4\cdot (n-1)$ so
$$n^2=\underset{1-term}{\underbrace{(n-2)^2}}+\underset{n-1\;-terms}{\underbrace{4+4+\dots+4}}$$
Examples (that differ from those I found) :
$6^2=4^2+4+4+4+4+4$
$7^2=5^2+4+4+4+4+4+4$
$8^2=6^2+4+4+4+4+4+4+4$
$9^2=7^2+4+4+4+4+4+4+4+4$
$10^2=8^2+4+4+4+4+4+4+4+4+4$
$11^2=9^2+4+4+4+4+4+4+4+4+4+4$
Proof of (b) : We have that
$n^2=(n^2-2\cdot n+1)+2n-1=(n-1)^2+(2n-1)\cdot 1$ so
$$n^2=\underset{1-term}{\underbrace{(n-1)^2}}+\underset{2\cdot n-1\;-terms}{\underbrace{1+1+\dots +1}}$$
Note that (a) is the particular case with $m=n$ of the Problem, and (b) is the particular case $m=2n$ of it.
Official Solution (adapted by CiP)
Let $k=\frac{2n}{m}$; it is, from the divisibility condition, a natural number, $k\geqslant 1$. From
$n^2=(n^2-2 n k+k^2)+2nk-k^2\;\;\overset{2n=k\cdot m}{=}\;(n-k)^2+km\cdot k-k^2=(n-k)^2+k^2 \cdot (m-1)$
and because $n-k=\frac{2n}{2}-k=\frac{k\cdot m}{2}-k=k\cdot \left (\frac{m}{2}-1\right )>0$
we have
$$n^2=(n-k)^2+\underset{m-1\;-terms}{\underbrace{k^2+\dots +k^2}}$$
QED $\blacksquare$