Compute 125^2 + 126^2 + 127^2 + .... + 250^2.
Is there a way of computing these sums efficiently?
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
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