Nicomachus theorem proof - what did I do wrong? The exercise asked me to proof
$1^3=1$
$2^3=3+5$
$3^3=7+9+11$
$...$
I formulate the equation as
(1)$$a^3 = \sum_{i=0}^{a-1} (a-1)a+1+2i$$
Proof base case:
$$1^3=\sum_{i=0}^{1-1} (1-1)(1)+1+2i=1$$
Proof (a+1) case:
(2) $$(a+1)^3=a^3+3a^2+3a+1$$
(3) $$(a+1)^3=\sum_{i=0}^{(a+1)-1}((a+1)-1)(a+1)+1+2i=\sum_{i=0}^{a}(a)(a+1)+1+2i$$
factor out last summation term, so number of iterations match (1):
$$\sum_{i=0}^{a-1}[(a)(a+1)+1+2i]+(a)(a+1)+1+2a=\sum_{i=0}^{a-1}[(a)(a+1)+1+2i]+a^2+3a+1$$
rearrange the summation term, so part of equation match (1):
$$\sum_{i=0}^{a-1}[(a)(a-1)+1+2i]+\sum_{i=0}^{a-1}(2a)+a^2+3a+1$$
substitute summation with (1):
(4) $$a^3+\sum_{i=0}^{a-1}(2a)+a^2+3a+1=a^3+(2a)(a-1)+a^2+3a+1=a^3+3a^2+a+1$$
From (2) I got $a^3+3a^2+3a+1$ but from (3) & (4) I got $a^3+3a^2+a+1$
My result with induction is off by 2a. Can someone please help me to understand where I did wrong?

Your attempt seems a little messy, so I hope you don't mind that I present an alternative approach to an inductive proof.
You want to show $\displaystyle (1+2+...+n)^2 = 1^3 + 2^3 +... + n^3$
Assume, for some $k$ that $\displaystyle (1+2+...+k)^2 = 1^3 + 2^3 +... + k^3$ as the inductive hypothesis and call the expression on the left hand side $A$.
Now, let $\displaystyle B = (1+2+...+k+ (k+1))^2$
By the difference of squares identity, $\displaystyle B-A \\= (k+1)(2(1+2+...+k) + (k+1)) = (k+1)(2(\frac 12)(k)(k+1)+(k+1)) = (k+1)(k+1)(k+1) = (k+1)^3$
Hence $\displaystyle B = A + (k+1)^3$, and using the inductive hypothesis (and showing the base case), the proof is complete.
Sometimes, using the summation notation tends to cloud the thought process.
