Powers for the sum of three squares

Say $n$ can be represented as a sum of three non-zero squares. (i.e. $n = a^2 +b^2+ c^2$, for some $n,a,b,c \in \mathbb{N}$)

Is it possible that every natural power of $n$ is also a sum of three non-zero squares? (i.e. $n^k = x^2+y^2+z^2$ for $x,y,z,k \in \mathbb{N}$)

• For the second part: it is possible iff you can not write $\;n^k=4^a(8b+7)\;,\;\;a,b\in\Bbb Z\;$ (note that this last is the integers, not merely *the naturals") – DonAntonio Mar 6 '18 at 9:51
• Dear David, just a remark. You have accepted an answer where we are also not sure whether the three squares are non-zero. But your claim without this restriction of non-zero follows more easily just by the three-square-theorem. The problem only is "non-zero squares". – Dietrich Burde Mar 8 '18 at 10:30

Yes, more generally, if, $$N = x_1^2+x_2^2+\dots+x_m^2$$ then one can always find integer $y_i$ such that, $$N^k = y_1^2+y_2^2+\dots+y_m^2$$

Proof: Use the expansion of

$$(a+i\sqrt{w})^k$$

To get,

$$a^2 + w = N,\\ (a^2 - w)^2 + (2 a)^2 w = (a^2 + w)^2,\\ (a^3 - 3 a w)^2 + (3 a^2 - w)^2 w = (a^2 + w)^3,\\ (a^4 - 6 a^2 w + w^2)^2 + (4 a^3 - 4 a w)^2 w = (a^2 + w)^4$$

and so on, then assume $w$ to be a sum of squares $w=b^2+c^2+\dots$

For example, for $k=3$,

$$\small\big(a^3 - 3 a (b^2+c^2+\dots)\big)^2 + \color{blue}{\big(3 a^2 - (b^2+c^2+\dots)\big)^2 \big(b^2+c^2+\dots\big)} = (a^2 + b^2+c^2+\dots)^3$$

then distribute the blue term. I trust the pattern for other $k$ is easy to discern.

• Is it clear that none of the $y_i$ will be zero? – Dietrich Burde Mar 6 '18 at 11:41
• @DietrichBurde: Good point. But at least the identity, given initial $k=1$, provides a simple algorithm to generate solutions to $a^2+b^2+c^2 = n^k$ which can then be tested if $abc\neq0$. I'll see if a tweak can address that point. – Tito Piezas III Mar 6 '18 at 12:19

Yes, this is possible. Take $n=3$. Clearly $3=1^2+1^2+1^2$. Now any power of $3$ is also the sum of three squares by the Three-Squares Theorem, because $3^k$ is not of the form $4^n(8m+7)$. This may include zero summands, though. Otherwise one has to give a direct solution. If $n=3^k$ with $k=2m+1$, then $3^k=(3^m)^2+(3^m)^2+(3^m)^2$. If $n=3^k$ with $k=2m$, then $$3^k=3^{2m}=(3^{m-1})^2+(2\cdot 3^{m-1})^2+(2\cdot 3^{m-1})^2$$

• Doesn't the three-squares theorem allow $abc=0$ (which the OP here precludes)? – Barry Cipra Mar 6 '18 at 10:07
• Yes, good point. Then one needs a direct presentation, i.e., $9=1^2+2^2+2^2$, $27=3^2+3^2+3^2$ and so on. – Dietrich Burde Mar 6 '18 at 10:13
• In any event, it seems to me that what the OP really wants is not a single example of an $n$ such that $n^k$ is the sum of three positive squares for all $k$, but a general proof that if $n$ is the sum of three positive squares, then so is $n^k$ for all $k\gt1$. And for that the sum-of-three-squares theorem isn't enough. – Barry Cipra Mar 6 '18 at 10:27
• Yes, but this claim may not even be true for all $n$. It certainly is true for single exapmles $n$, like $n=3$. I would now look for a counterexample. – Dietrich Burde Mar 6 '18 at 10:31
• In googling on sums of three positive squares, I came across something I'd quite forgotten: mathoverflow.net/questions/90914/sums-of-three-non-zero-squares – Barry Cipra Mar 6 '18 at 10:41