+0  
 
-1
531
2
avatar

Compute 125^2 + 126^2 + 127^2 + .... + 250^2.

 

Is there a way of computing these sums efficiently?

 Jun 22, 2020
 #1
avatar+1005 
-1

Read guest's answer below

 

I'll give you a point later and subtract for mine, but the site won't let me do it now

 Jun 22, 2020
edited by hugomimihu  Jun 22, 2020
edited by hugomimihu  Jun 22, 2020
edited by hugomimihu  Jun 22, 2020
 #2
avatar
+1

There is a formula for summing up "Consecutive squares" , but it starts at 1 and up. You could sum them up in 2 tries: From 1 to 250 and from 1 to 124 and the subtract one from the other:

 

n = 250; a = 1/6 * (2*n + 1)*n*(n + 1) =5,239,625

n = 124; a = 1/6 * (2*n + 1)*n*(n + 1) =643,250

 

5,239,625 - 643,250 = 4,596,375 - the sum of your sequence from 125^2 to 250^2

 Jun 22, 2020

0 Online Users