# Are there identities which show that every odd square is the sum of three squares?

I am looking for algebraic identities of the form $$(2n+1)^2 = f(n)^2 + g(n)^2 + h(n)^2,$$ where the functions are polynomials in $n$.

EDIT: Evidently $(6k)^2 = 36k^2$ is trivially the sum of three squares when $k$ is odd. We also have the identity $$(6k+3)^2 = (2(2k+1))^2 + (2(2k+1))^2 + (2k+1)^2.$$ Are there similar identities for the other two odd residues modulo $6$, i.e., $6k+1$ and $6k-1$?

• you can try using triangular numbers to express the RHS while keeping the LHS as is ( 2n+1)^2. I assume that f,g and h(n) are not in general equal or consecutive squares. – user25406 Feb 12 '17 at 20:01

That's not really going to work, the highest degree terms do not cancel here, so all you get is $(2n+1)^2 = (2n+1)^2 + 0^2 + 0^2.$

What does work is due to Gordon Pall; every number is the sum of four squares, so write $$2n+1 = a^2 + b^2 + c^2 + d^2.$$ Then you get nontrivial expressions $$(2n+1)^2 = \left(a^2 + b^2 - c^2 - d^2 \right)^2 + (-2ad+2bc)^2 + (2ac+2bd)^2$$ and similar things resulting from rearranging the letters $a,b,c,d$ and choosing many $\pm$ signs.

See Pall_Automorphs_1940.pdf at http://zakuski.math.utsa.edu/~kap/forms.html

Let's see, if $2n+1$ is already a square, perform the same task for $\sqrt {2n+1},$ so as to be assured of at least two nonzero summands. If $2n+1$ is a fourth power...

Given a specific integral expression such as $9 = 4 + 4 + 1,$ we can produce a rational expression $$\left( \frac{4n+2}{3}\right)^2 + \left( \frac{4n+2}{3}\right)^2 + \left( \frac{2n+1}{3}\right)^2 = (2n+1)^2.$$ While $49 = 36 + 9 + 4$ results in $$\left( \frac{12n+6}{7}\right)^2 + \left( \frac{6n+3}{7}\right)^2 + \left( \frac{4n+2}{7}\right)^2 = (2n+1)^2.$$ These are just three rational multiples of $(2n+1),$ that is the only way it can work. Plus, these only produce integer expressions for certain $n.$

• Oh, this is nice. – Andrés E. Caicedo Oct 4 '13 at 1:25
• Is that still the case if we allow polynomials with rational (non-integer) coefficients? – Kieren MacMillan Oct 4 '13 at 1:26
• @Will: This is very nice, especially after "Given a specific…". I will continue in that direction — perhaps by setting 2n+1=8N+[1,3,5,7] or 18N+[1,3,5,…,17], I (we) could come up with enough rational expressions to cover all integral possibilities. – Kieren MacMillan Oct 4 '13 at 13:09
• So, for example, the first identity requires $n \equiv 1\!\pmod{3}$. Writing $n=3k+1$ and substituting, we obtain the [integral] identity $$\bigr(2(2k+1)\bigr)^2 + \bigr(2(2k+1)\bigr)^2 + (2k+1)^2 = (6k+3)^2.$$ I'll look into others, based on your example/method. – Kieren MacMillan Oct 4 '13 at 17:10

For the equation:

$$x^2+y^2+z^2=(6k+5)^2$$

You can write for example this solution:

$$x=10s^2+4(4p-13)s+10p^2-50p+72$$

$$y=20s^2+2(16p-47)s+20p^2-92p+120$$

$$z=20s^2+32(p-3)s+20p^2-90p+121$$

$$k=5s^2+8(p-3)s+5p^2-23p+30$$

• Except I don't think that gives every possible $k$. – Kieren MacMillan Oct 3 '14 at 12:09
• @KierenMacMillan I wrote the simplest solution. You can write and cumbersome solution, but do not see sense in this. – individ Oct 3 '14 at 12:18
• The point is to have a complete solution. Do you also not see the sense in having a complete solution to the Pythagorean equation? – Kieren MacMillan Oct 3 '14 at 15:40
• @KierenMacMillan Before you can find the complete solution of the equation of Pythagoras - find the quotient. – individ Oct 3 '14 at 15:45
• What does that even mean? – Kieren MacMillan Oct 3 '14 at 19:42