Sum of Squares of Consecutive Positive Integers

Calculate \(N_1^2 + (N_1+1)^2 + \cdots + N_2^2\) for any positive integers \(N_1 < N_2\).

Understanding the Sum of Squares

For consecutive positive integers from \(N_1\) to \(N_2\), the sum of squares is given by:

\[ \sum_{k=N_1}^{N_2} k^2 = N_1^2 + (N_1+1)^2 + \cdots + N_2^2 \]

There is a closed-form formula for the sum of squares from 1 to n:

\[ \sum_{k=1}^{n} k^2 = \frac{n(n+1)(2n+1)}{6} \]

Therefore, the sum from \(N_1\) to \(N_2\) can be computed as:

\[ \sum_{k=N_1}^{N_2} k^2 = \frac{N_2(N_2+1)(2N_2+1)}{6} - \frac{(N_1-1)N_1(2(N_1-1)+1)}{6} \]

Sum of Squares Calculator

Enter two positive integers with \(N_1 < N_2\)
Enter positive integers with \(N_1 < N_2\).
Sum of squares from \(N_1\) to \(N_2\) =
--

Related Resources

analyzemath.com — Interactive tool for summing squares of consecutive integers with step-by-step explanation.