Given a set S = $({1,2,...,(n-1))}$, we obtain the sum of all of its entries through $$S_n= \frac{1}{2}n(n-1)$$ that we derive from $S_n=\frac{1}{2}n(a_1 +a_n)$. The issue is, let us square our set, $S_n^2=({1^2,2^2,...,(n-1)^2)}$, from this we get $$S^2_n =\frac{n^3}{3}-\frac{n^2}{2}+\frac{n}{6}$$. That is the question, though, how do we get this value,
I am confused about how to reach that. I have tried to go through $$\frac{1}{2}(n-1)((n-1)^2+1^2)$$, the problem with this is that it gives off a result that does not equal the one mentioned in the title, so there is no point in trying to simplify it. Can someone help me? Thank you.
The formula for the sum of squares is given by $$1^2+2^2+\ldots+n^2=\frac16 n(n+1)(2n+1).$$ Applying this, we have $$1^2+\ldots+(n-1)^2=\frac16(n-1)n(2n-1)=\frac13 n^3-\frac12n^2+\frac16n\,.$$
Your mistake is to use the AP formula when you do not have an arithmetic progression.