# On $(n+3)^2-(n+2)^2-(n+1)^2+n^2=4$ and Other Related Identities

I have two questions.

1. Does anyone know what the name of this identity is or what I should look up to find out more information about it?

2. How is this identity used to prove that all integers can be represented as $\sum_{k=1}^n\pm k^2$?

Here and here are the two places where I have seen this identity. I have been unable to find out more about these topics as I don't know what I should be looking for.

• This would be a "derivative of the difference of squares" identity. It follows literally from the difference of squares formula. – астон вілла олоф мэллбэрг Sep 25 '16 at 4:24
• Thank you, that answers my first question. What about the second one? – AlgorithmsX Sep 25 '16 at 4:28
• Do you need an answer via the above identity? Because I think we can answer this question without needing that identity. Besides, you want only the sum or difference of two squares, right? Otherwise, I could just add 1s until I reach the number. – астон вілла олоф мэллбэрг Sep 25 '16 at 4:39
• I misread the original post. They were talking about distinct integers. If they weren't distinct, using ones would work. – AlgorithmsX Sep 25 '16 at 4:44
• Okay, so I have to use distinct integers, but I can add and subtract how many ever squares I want? Then I will tell you, every number that is not an even non-multiple of four can be written as the difference of squares. – астон вілла олоф мэллбэрг Sep 25 '16 at 4:50

For 2, you now know you can add $4$ to any number you can represent. If you can represent $0, 1, 2, 3$, you can represent any number by adding in the proper amount of $4$s. You then say $0=0, 1=1^2, 2=6^2-5^2-3^2, 3=6^2-5^2-3^2+1^2$ and declare victory.
• I figured that if I had the name or something to look for to get these general identities and how this proves some result, I could find more things like it. As far as I can tell, there is no way to go from $(n+3)^2-(n+2)^2-(n+1)^2+n^2$ to Reyley's Theorem or any related results. Also, the sources I cited lacked the proof that if they could prove that they could get one through four, they could get all integers. – AlgorithmsX Sep 25 '16 at 15:50