## (x-n)^3 + (x-n+1)^3 + … + x^3 + (x+1)^3 + … + (x+n)^3

An integer of the form   $T_{n} \; = \; n \, (n + 1)/2$   is called a Triangular number.

$(n-1)^3+n^3+(n+1)^3$
$= \; 3 \, n^3 \; + \; 6 \, n$
$= \; (1/2 \; (n+1) \, (n+2))^2 - (1/2 \; (n-2) \, (n-1))^2$

$(n-2)^3+(n-1)^3+n^3+(n+1)^3+(n+2)^3$
$= \; 5 \, n^3 \; + \; 30 \, n$
$= \; (1/2 \; (n+2) \, (n+3))^2 \; - \; (1/2 (n-3) \, (n-2))^2$

$(n-3)^3+(n-2)^3+(n-1)^3+n^3+(n+1)^3+(n+2)^3+(n+3)^3$
$= \; 7 \, n^3 \; + \; 84 \, n$
$= \; (1/2 \; (n+3) \, (n+4))^2 \; - \; (1/2 \; (n-4) \, (n-3))^2$

$(n-4)^3+(n-3)^3+(n-2)^3+(n-1)^3+n^3+(n+1)^3+(n+2)^3+(n+3)^3+(n+4)^3$
$= \; 9 \, n^3 \; + \; 180 \, n$
$= \; (1/2 \; (n+4) \, (n+5))^2 \; - \; (1/2 \; (n - 5) \, (n - 4))^2$

In general:

$(x-n)^3 + (x-n+1)^3 + ... + x^3 + (x+1)^3 + ... + (x+n)^3$
$= 2 \, n^3 \, x + 3 \, n^2 \, x + 2 \, n \, x^3 + n \, x + x^3$
$= (1/2 \; (x+n) \, (x+n+1))^2 \; - \; (1/2 \; (x-n-1) \, (x-n))^2$