# Difference of the difference of consecutive squares

I was playing around with the square numbers and I noticed something:

$$\left. \begin{array}{r} &\left. \begin{array}{r} &1^2 = 1\\ &2^2=4\\ \end{array} \right\} \ 3 \\ &\left. \begin{array}{r} &2^2 = 4\\ &3^2=9\\ \end{array} \right\} \ 5 \end{array} \right\} \ 2$$ $$\left. \begin{array}{r} &\left. \begin{array}{r} &3^2 = 9\\ &4^2=16\\ \end{array} \right\} \ 7 \\ &\left. \begin{array}{r} &4^2 = 16\\ &5^2=25\\ \end{array} \right\} \ 9 \end{array} \right\} \ 2$$

The fact the difference of consecutive squares is $2n+1$ is easily justified, $(n+1)^2-n^2=2n+1$.

$$\text{Let } D_n := |a_{n+1}-a_n| = 2n+1, \text{Where } a_n=n^2$$ $$\text{Then } |D_{n+1}-D_n|=|2(n+1)+1-(2n+1)|=2$$ And this is the same as the derivative of $D_n$, $\displaystyle \frac{d}{dn}(2n+1)=2$. This makes some intuitive sense to me, $2$ is how much the difference between squares changes. However, talking about derivatives in $\mathbb{N}$ seems fallacious to me. Is this just a happy coincidence?

• It's a little bit more than a coincidence. Try it for cubes! (but take it 3 steps instead of just two) Commented Feb 20, 2015 at 10:50

Note that any sequence $(a_n)$ of integers may be thought of as a function $a : \Bbb N \rightarrow \Bbb Z$, where $a(n) = a_n$. We may then define the operator $\Delta$ on such functions, so that if $a : \Bbb N \rightarrow \Bbb Z$, then $\Delta[a] = a(n+1) - a(n)$. This is a linear operator on such functions, just as the derivative operator $\frac{\mathrm{d}}{\mathrm{d}x}$ is linear.
Also, note that $\Delta[c] = c - c = 0$ for any constant $c$, also analogous to the derivative. Note that $\Delta[n] = n + 1 - n = 1$, still analogous. This allows us to reach our result with linearity: $\Delta[2n+1] = 2\Delta[n] + \Delta[1] = 2 \times 1 + 0 = 2$.
However, in general, the "power rule" does not apply--rather, it is the "permutation rule". Where in normal derivatives, $\frac{\mathrm{d}}{\mathrm{d}x}[x^k] = kx^{k-1}$, with finite differences, the analog is $\Delta[_{n}P_{k}] = k _{n}P_{k-1}$.
There are even slightly modified versions of the product and quotient rules for $\Delta$, but I leave these as an exercise to the reader.