The sum can be expressed as
result = Sum{k=1..n} (n+1-i) * k^3
= (n+1) * Sum{k=1..n} k^3 - Sum{k=1..n} k^4
(Sorry, no idea how to use mathematica symbols in HTML)
There are closed solutions for the two sums of k^a for any positive integral number a. You can find the solution for Sum(k^3) and a simple algorithm to derive the solution for Sum(k^4) at
Sum of n, n², or n³ | Brilliant Math & Science Wiki[
^]
The formula for k^3 as offered right at the top of that web site is:
Sum{k=1..n} (k^3) = n^2*(n+1)^2 / 4
and the sum for k^4 is given at the very bottom as:
Sum{k=1..n} (k^4) = n*(n+1)*(2*n+1)*(3*n^2+3*n-1) / 30
Now all you have to do is calculate both, multiply the former by (n+1). and subtract the latter.
P.S.: Here's a little program to prove the formulas are working as intended:
#include <iostream>
using namespace std;
double sum_of_power3(int n)
{
double dn = (double)n;
return dn*dn*(dn+1)*(dn+1)/4;
}
double sum_of_power4(int n)
{
double dn = (double)n;
return dn*(dn+1)*(2*dn+1)*(3*dn*dn+3*dn-1)/30;
}
int main()
{
double sn3 = 0;
double sn4 = 0;
for (int n = 1; n < 5; ++n)
{
sn3 += n*n*n;
sn4 += n*n*n*n;
cout << "sum of " << n << "^3 " << sn3 << " " << sum_of_power3(n) << endl;
cout << "sum of " << n << "^4 " << sn4 << " " << sum_of_power4(n) << endl;
}
return 0;
}
Output:
sum of 1^3 1 1
sum of 1^4 1 1
sum of 2^3 9 9
sum of 2^4 17 17
sum of 3^3 36 36
sum of 3^4 98 98
sum of 4^3 100 100
sum of 4^4 354 354