# Is there an equation for the sum of alternating cubes?

The following sequences for sum of alternating cubes:

Odd cubes: [1, 28, 153, 496, 1225, 2556, 4753, 8128, 13041, 19900, 29161, 41328, 56953, 76636, 101025, 130816, 166753, 209628, 260281, 319600]

Even cubes: [8, 72, 288, 800, 1800, 3528, 6272, 10368, 16200, 24200, 34848, 48672, 66248, 88200, 115200, 147968, 187272, 233928, 288800]

Nothing on OEIS. Trying to find equations for generating such values.

-
You may also want to look at: en.wikipedia.org/wiki/Cube_(algebra) in addition to the nice answer by Ross M. –  Amzoti Nov 26 '12 at 5:02
Not sure why there are three answers and yet none of them seem to answer the question directly -- figured it out: Odd sum: $a(n) = n^2(2n^2-1)^2$ Even sum: $a(n) = 2n^2(n+1)^2$ –  KaliMa Nov 26 '12 at 5:14
Are you sure the odd sum is correct? –  Amzoti Nov 26 '12 at 5:30
@Amzoti Typo'd it, shouldn't be squared at the end –  KaliMa Nov 26 '12 at 5:33
Still looks like there is a problem, shouldn't it be: type "Sum[(2*i+1)^3,{i,0,n}]" at woframalpha and see if it matches. You can remove the +1 for the even result. –  Amzoti Nov 26 '12 at 5:39

$$\sum\limits_{i=1}^n(2i)^3=8\sum\limits_{i=1}^ni^3$$ $$\sum\limits_{i=1}^n(2i-1)^3=\sum\limits_{i=1}^{2n}i^3-\sum\limits_{i=1}^n(2i)^3$$

Of course, the sum of cubes is (for some strange reason...) the square of the sum of consecutive integers.

$$\sum\limits_{i=1}^ni^3=\left(\sum\limits_{i=1}^ni\right)^2=\frac{n^2(n+1)^2}4$$

-
Here is a question regarding the strange reason. –  robjohn Feb 3 '13 at 13:39

There is a very general way for producing formulae for functions $F:\mathbb{N} \rightarrow \mathbb{Z}.$ Let me explain.

Consider the set of functions $F:\mathbb{N} \rightarrow \mathbb{Z}.$ On such functions there is a discrete analog of differentiation called the shift operator, denoted $\Delta$, which given a function $F$ produces a function $\Delta F$ via the formula $\Delta F(x) := F(x+1) - F(x).$ Now classically, if one is given an infinitely differentiable function $f:\mathbb{R} \rightarrow \mathbb{R}$ one can consider the Taylor series $\displaystyle\sum_{i=0}^{\infty} \frac{f^{(k)}(0)}{k!}x^k$ and ask if this series converges and is equal to $f$ near $0.$ In the discrete case, note that iterated powers of the shift operator are always well defined. So it is natural to ask if there is a discrete analog of Taylor series. These analogs are called Mahler series. Given a function $F:\mathbb{N} \rightarrow \mathbb{Z},$ we define it's Mahler series via the formula

$$\sum_{i=0}^{\infty} \Delta F(0){{x}\choose{k}}.$$

The next question to ask is when is $F$ equal to it's Mahler expansion. And this is where the discrete case is nicer than the classical, for the answer is always. That is

$$F(x) = \sum_{i=0}^{\infty} \Delta F(0){{x}\choose{k}}$$

for all $x \in \mathbb{N}$

(Note if $k>x,$ we have ${x\choose k} = 0$ so there is no issue of convergence in the above series).

So if I have such a function $F:\mathbb{N} \rightarrow \mathbb{Z}$ which I want to express via a nice formula, a good place to begin is to try to write down it's Mahler expansion.

$$F(x) = \sum_{i=0}^{x} (2i)^3.$$

Then

$$\Delta F(x) = (2(x + 1))^3$$

$$\Delta^2 F(x) = (2(x + 2))^3 - (2(x + 1))^3 = 24x^2 +72x + 56$$

$$\Delta^3 F(x) = \Delta^2 F(x+1) - \Delta^2 F(x) = 192x + 208$$

$$\Delta^4 F(x) = \Delta^3 F(x+1) - \Delta^3 F(x) = 192$$

and

$$\Delta^k F(x) = 0 \text{ if } k\ge5.$$

It follows

$$F(x) = {{x}\choose{1}} + 56{{x}\choose{2}} + 208{{x}\choose{3}} + 192{{x}\choose{4}}.$$

Following the same mechanical procedure we can also produce a formula for the some of the cubes of the odd natural numbers and many other functions of this sort.

-

For the odd cubes, you are asking about $\sum_{i=0}^n (2i+1)^3=\sum_{i=0}^n 8i^3+12i^2+6i+1$. Now feed each term to Faulhaber's formula

For the even cubes, you want $\sum_{i=1}^n (2i)^3=8\sum_{i=1}^n i^3$

-
I think I figured out the odd cubes via n^2*(2n^2 - 1). Having trouble with evens. –  KaliMa Nov 26 '12 at 5:02
@KaliMa: For the evens, the sum is just $\frac 16 n(n+1)(2n+1)$ –  Ross Millikan Nov 26 '12 at 5:03
I thought that equation is for the sum of first n general cubes (even and odd together) –  KaliMa Nov 26 '12 at 5:05
@KaliMa: True, but the upper index is half the last number that is cubed. The idea is if you want to do something with all the evens, just do it with all the numbers and double them. The factor 8 accounts for the doubling. –  Ross Millikan Nov 26 '12 at 5:07
@KaliMa: No, $40=8(1+4)=8(1+2^2), 8+64=8(1+2^3)=8(1+8)=72$ –  Ross Millikan Nov 26 '12 at 5:11