# Triangular Numbers and Sum of Two Squares

"If n is a triangular number, show that each of the three consecutive integers, $8n^2, 8n^2+1, 8n^2+2$ can be written as a sum of two squares."

I have spend hours working on this problem and cannot seem to get anywhere with it. I was advised to start with $8n^2+1$ and work through it just using algebra to express this as a sum of two squares, but I am really struggling. Can anyone help?

It is assumed in the books on this subject that all square $a^2$ is a sum of two squares $a^2+0^2$.

► Note first that for all $n$ one has $$8n^2=(2n)^2+(2n)^2\qquad (1)$$ Now all triangular number $n$ is of the form $$n=\frac{m(m+1)}{2}$$ Hence $$8n^2=\frac{8m^2(m+1)^2}{4}=2(m^2+m)^2$$ It follows the two identities

$$2(m^2+m)^2+1=(m^2-1)^2+(m^2+2m)^2\qquad (2)$$ $$2(m^2+m)^2+2= (m^2+m+1)^2+(m^2+m-1)^2\qquad (3)$$

With $(1),(2),(3)$ we have verified that the statement is true.

• Looks like in (2) and (3) you evaluated for $8n+1$ and $8n+2$ respectively, but the problem is for $8n^2+1$ and $8n^2+2$? – tdaaaa Apr 12 '16 at 20:50
• @tdaaaa: I have edited correctly now. Thanks. – Piquito Apr 15 '16 at 16:26

$8n^2$ is trivial, since $8n^2=(2n)^2+(2n)^2$.

For the first triangular numbers, we have

• $8\cdot1^2+1=9=0^2+3^2$
• $8\cdot3^2+1=73=3^2+8^2$
• $8\cdot6^2+1=289=8^2+15^2$
• $8\cdot10^2+1=801=15^2+24^2$
• ...

Note that the numbers $0,3,8,15,24,\ldots$ form the sequence $\{n^2-1\}$.

Do something similar for $8n^2+2$.

• $10=1^2+3^2$
• $74=5^2+7^2$
• $290=11^2+13^2$
• $802=19^2+21^2$
• ...

The "small" squares sequence is $1,5,11,19,\ldots$, which is $2(n-0.5)^2+0.5$.

• Wow, that was a lot simpler than mine :) – Simpson17866 Apr 12 '16 at 19:32
• I got $8n^2+1$! But when I tried this method for $8n^2+2$, the numbers I got are $1, 3, 5, 7, 11, 13, 19, 21, ...$ and I don't see how I can represent this sequence as a function of $n$ as the same way as above? – tdaaaa Apr 13 '16 at 4:32

Note that $$8n^2=(2n)^2+(2n^2)$$ and $$8n^2+2=(2n-1)^2+(2n+1)^2$$ so it is both $8n^2$ and $8n^2+2$ can be expressed as the sum of two squares, whether or not $n$ is a triangular number.

HINT:

If $n$ is a triangle number, than there is a $k$ that gives you $n = \frac{k*(k+1)}{2},$ which then gives us

$8n^2 = 2*k^2*(k+1)^2 = a^2+b^2$

$8n^2$ is even, so a and b are either both even or both odd.

$8n^2+1 = 2*k^2*(k+1)^2+1 = c^2+d^2 = a^2+b^2+1$

$8n^2 + 1$ is odd, so "c" is even and "d" is odd.

$8n^2+2 = 2*k^2*(k+1)^2 = e^2+f^2 = c^2+d^2+1 = a^2+b^2+2$

$8n^2+2$ is even, so "e" and "f" are either both even or both odd.

Does this give you an idea for what to do next?

• I don't see how knowing a and b are both odd or even, or c odd/d even helps with the algebra? – tdaaaa Apr 12 '16 at 20:19