$5^m$, where m is any natural, can be expressed as the sum of two perfect squares? Prove that for all natural $m$, $5^m$ can be expressed as the sum of two perfect squares.
Also, prove that $5^m + 2$ can be expressed as the sum of three perfect squares.
 A: You can prove the first statement by induction on $m$. $m = 1$: $5^1 = 5 = 1+4 = 1^2+2^2$. Assume $5^m = a^2+b^2$, we have: $5^{m+1} = (1^2+2^2)(a^2+b^2) = (a-2b)^2+(b+2a)^2$ is a quite well-known identity.
A: Any odd number, squared, becomes $1 \pmod 8.$ As a result, for any odd $m > 0,$ 
$$ 5^m \equiv 5 \pmod 8.  $$
So, for any odd $m,$
$$ 5^m + 2 \equiv 7 \pmod 8.  $$
So, this is not the sum of three integer squares. See https://en.wikipedia.org/wiki/Legendre%27s_three-square_theorem
A: See KfSsOc's answer for your first statement.
Your second statement is true even m because $m=2n$ for some natural number n, and $5^m+2=5^{2n}+2=(5^n)^2+1^2+1^2$, but it is not true in general; specifically it is not true for $5^1+2=7$ and $5^3+2=127$. (For other odd m https://oeis.org/A004215 might be helpful, but note it refers to sums of nonzero squares, and you can separately take care of the case where one of the squares is zero.)
A: For the first question, the main point is that if $x$ and $y$ can be expressed as the sum of two squares, so can $xy$. The Brahmagupta–Fibonacci identity, which comes from the multiplication of complex numbers, shows this:
$$
\left(a^2 + b^2\right)\left(c^2 + d^2\right)
= \left(ac-bd\right)^2 + \left(ad+bc\right)^2
= \left(ac+bd\right)^2 + \left(ad-bc\right)^2
$$
So, it is enough to prove that $5$ is a sum of two squares and this is easy: $5=1^2+2^2$.
A: Yet another argument, based on the arithmetic of the Gaussian integers $\Bbb Z[i]$. There’s the (clearly) multiplicative map $\Bbb Z[i]\to\Bbb Z$, $a+bi\mapsto(a+bi)(a-bi)=a^2+b^2$, so the norm of any element is sum of two squares. Now the norm of $2+i$ is $5$, so that the norm of $(2+i)^n$ is $5^n$. But if $(2+i)^n$ expands out to $A+Bi$, we then get $5^n=A^2+B^2$.
