<s>[INST] Proving formula for sum of squares with binomial coefficient $$\sum_{k=0}^{n-1}(k^2)= \binom{n}{3} + \binom{n+1}{3}$$
How should I prove that it is the correct formula for sum of squares?
Should I use induction to prove the basis? Any help is appreciated.
 [/INST] Yes you can. Base case is easy. After it, you have to prove following implication.
$$\left(\underbrace{\sum_{k=0}^{n-1}(k^2)= \binom{n}{3} + \binom{n+1}{3}}_{\mathrm{Assumption}}
\right) \Longrightarrow \left(
\underbrace{\sum_{k=0}^{n}(k^2)= \binom{n+1}{3} + \binom{n+2}{3}}_{\mathrm{Thesis}}
\right)
$$
Now, using assumption transform thesis.
$$\begin{split}
\sum_{k=0}^{n}(k^2) 
= n^2 + \sum_{k=0}^{n-1}(k^2) 
&=  n^2 + \binom{n}{3}+\binom{n+1}{3}\\
&= n^2 + \frac{n!}{3!\cdot (n-3)!} +\binom{n+1}{3}\\
&=n^2 + \frac{n \cdot (n-1) \cdot (n-2)}{6} + \binom{n+1}{3}\\
&=\frac{6n^2 + \left(n^3-3n^2+2n\right)}{6}+ \binom{n+1}{3}\\
&=\frac{n(n+1)(n+2)}{3!}+ \binom{n+1}{3}\\
&=\frac{(n+2)!}{3! \cdot \left((n+2)-3\right)!}+ \binom{n+1}{3}\\
&= \binom{n+2}{3} + \binom{n+1}{3}
\end{split}$$
$\mathscr{Q.E.D.}$
</s>