Sum of first n squares calculator

Compute the exact sum 1²+2²+…+n² for nonnegative integers.

Enter values

Start with the example below, or enter your own values.

How it works

Use n(n+1)(2n+1)/6, including n=0.

Try an example

Number of terms: 10. The form starts with these values; change them to explore your own case.

Example result: 385

  1. Use the exact sum n(n+1)(2n+1)/6.

Learn more in Discrete mathematics and sequences.

Results are calculated locally. Floating-point tools provide numerical approximations, not formal proof certificates.