The sum of the squares of the first n natural numbers is 1^2 + 2^2 + ... + n^2. The square of the sum is (1 + 2 + ... + n)^2. Find the difference between the square of the sum and the sum of the squares for the first n natural numbers.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= n <= 10^4
Tags: