🏠
Guest Not signed in

Sum of Powers

90 seconds of Gauss / sum-of-squares / sum-of-cubes formulas

90.0s

Technique: Three closed-form formulas

Three identities collapse the “sum the first n” problem from a loop into a single computation:

  • Σn (Gauss sum)1 + 2 + … + n = n(n+1) / 2
  • Σn²1² + 2² + … + n² = n(n+1)(2n+1) / 6
  • Σn³1³ + 2³ + … + n³ = (n(n+1)/2)² (square of the Gauss sum!)

Examples

  • 1 + 2 + … + 50 = 50×51/2 = 1275
  • 1² + 2² + … + 10² = 10×11×21/6 = 2310/6 = 385
  • 1³ + 2³ + … + 5³ = (15)² = 225

Why does this work?

The Gauss sum is the classic schoolboy story — pair off 1+n, 2+(n-1), …, each pair sums to n+1, there are n/2 pairs. The Σn² and Σn³ formulas come from telescoping or induction; the elegant fact that Σn³ = (Σn)² is worth memorising on its own.

These show up under interview questions framed as “cumulative cost,” “triangle / pyramid totals,” or anywhere you can substitute a closed form for a loop. Every question has a 30 second shot clock.

Independent · Legal