<s>[INST] Sum of Squares of odd numbers I just wanted to know how we get from the first step to the next. I spent too much time on this but could not get to the next step. This seems a simple sum of squares of odd numbers but was not able to get the next step.
$$ \frac{2 \mathcal{E}_p}{M} \left(1^2 + 3^2 + 5^2 + \dots + (M-1)^2\right) $$
$$ \frac{2 \mathcal{E}_p}{M} \times \frac{M(M^2-1)}{6} $$
 [/INST] By Faulhaber's formulas, $$1^2+2^2+\cdots + (M-1)^2=\frac{(M-1)M(2M-1)}{6}$$
Since $M-1$ is odd, we must have $M-2$ even.  We now calculate, using the same formula,
$$2^2+4^2+\cdots+(M-2)^2=2^2(1^2+2^2+\cdots+(\frac{M-2}{2})^2)=2^2\frac{\frac{M-2}{2}\frac{M}{2}(M-1)}{6}=\frac{(M-2)M(M-1)}{6}$$
Subtract the sum of the even squares, from the sum of all the squares, to get
$$1^2+3^2+\cdots+(M-1)^2=\frac{(M-1)M(2M-1)}{6}-\frac{(M-2)M(M-1)}{6}=\frac{(M-1)M}{6}(2M-1-(M-2))=\frac{(M-1)M(M+1)}{6}=\frac{M(M^2-1)}{6}$$
</s>