Sum Square Difference¶
In problem 1, we applied the following formula for triangular numbers: $$1 + 2 + 3 + \cdots + n = \frac{n(n+1)}{2}$$ We can apply it again here and determine that $$(1 + 2 + 3 + \cdots + 100)^2 = \left(\frac{100(101)}{2}\right)^2 = 25502500$$
A similar formula exists for computing sums of squares, also called the square pyramidal numbers: $$1^2 + 2^2 + 3^2 + \cdots + n^2 = \frac{n(n+1)(2n+1)}{6}$$ (In fact, Faulhaber's formula gives a formula for the sum of $k$th powers, but we obviously only need the cases $k=1$ and $k=2$ for this problem.) Consequently, $$1^2 + 2^2 + 3^2 + \cdots + 100^2 = \frac{100(101)(201)}{6} = 338350$$
Therefore, the difference is $25502500 - 338350 = 25164150$.
Relevant sequences¶
Copyright (C) 2025 filifa¶
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license and the BSD Zero Clause license.