Easy Shortcuts
Find the sum
needs to be a whole number
sum=
or
take 1+2+...+n-1+n =
take half of n then add half
then take yor number after that multipy
(n/2+1/2)n
Proof:
if x = sum (1...n) then
x + (n + 1) = n * (n+1) / 2 + (n + 1)
x + (n + 1) = (n * (n + 1) + 2n +2) / 2
x + (n + 1) = ((n*n + n) + 2n + 2) / 2
x + (n + 1) = (n*n + 3 *n + 2) / 2
x + (n + 1) = ((n + 1) * (n + 2)) / 2
What if it doesn't start at 1?
Like 15+16+17+...
Minus the smaller consecutive numbers from the bigger ones.
Try from 21 to 80.
(80+1) * (80/2) - (20/2) * (20+1)
=(81 * 40) - (10 * 21)
=3240 - 210
=3030