The previous one shows how to develop a formula for summing consecutive natural numbers.
If you want to sum consecutive squares, that's more involved.
You would need to understand the previous one quite well before attempting
to find a quick way to sum squares.
Here is a way to do it using "telescoping".
If you want to sum squares from r=1 to n-1, then you could use the following
all the way to
When these are summed, all terms except and 1 cancel.
2 summed n-1 times is 2(n-1)
If we sum all the way to n, this is more commonly known as the sum of squares