The formula for calculating the sum of all natural integers from 1 to n is well-known: Sn = 1 + 2 + 3 + ... + n = n 2 + n 2 Similary, we know about the formula for calculating the sum of the first n squares: Qn = 1 · 1 + 2 · 2 + 3 · 3 + ... + n · n = n 3 3 + n 2 2 + n 6 Now, we reduce one of the two multipliers of each product by one to get the following sum: Mn = 0 · 1 + 1 · 2 + 2 · 3 + 3 · 4 + ... + (n − 1) · n Find an explicit formula for calculating the sum Mn.
Mn = 0 · 1 + 1 · 2 + 2 · 3 + 3 · 4 + ... + (n − 1) · n
Explicit formula:
(n(n + 1)(2n + 1))/6 - (n(n +1))/2 = [n(n + 1) ((2n + 1) - 3)]/6
final answer: [n(n + 1) ((2n + 1) - 3)]/6
for example:
n = 3
Mn = 0*1 + 1*2 + 2*3 = 2 + 6 = 8
[n(n + 1) ((2n + 1) - 3)]/6 = [2(2 + 1) ((2 * 2 + 1) - 3)] / 6 = (3 * 4 * 4)/6 = 16/2 = 8
Comments
Leave a comment