Sum of the first $3075$ squares

50 Views Asked by At

I am attempting to solve the following:

$$3075^2 + 3074^2 + 3073^2 +\dotsb+ 1^2$$

Does anyone have any advice for exactly how I could plug this into R or Python?

1

There are 1 best solutions below

0
On

Remember the formula for the sum of the first $k$ squares:

$$\sum_{k=1}^n k^2 = 1^2+2^2+\dots+(n-1)^2+n^2={n(n+1)(2n+1)\over 6}$$

Thus:

$$\sum_{k=1}^{3075} k^2 = 1^2+2^2+\dots+3074^2+3075^2={3075(3076)(6151)\over 6}$$