Deriving the Formula for the Polynomial Sequence
Introduction
When trying to find a rule for polymonial sequences in an easier way, I stumbled upon an alternative formula for the sum of the powers. First, we need to learn polynomial sequences and then we will derive the formula for the sum of the powers.
A polynomial sequence is a sequence that results from evaluating a polymonial with real coefficients at integer values. Our goal here is to find the rule, or formula, that gives the nth term if we know the first few terms in the sequence.
For example, suppose we are given the sequence, S_{n} = {1, 3, 10, 26, 45, 91, 158, 250, …}, and we want to find the rule for the sequence. Given the condition that the sequence fits the model \(S_n = k_{i}x^n + k_{i-1}x^{n-1} + \) \( k_{i-2}x^{n-2} + k_{i-3}x^{n-3} + \) \(k_{i-4}x^{n-4} + ... + k_0\), how do we find the coefficients denoted by k’s of the model. One way is to solve an n × n matrix to find the coefficients but that would be cumbersome for large n.
Another approach involves finding the n-level differences of the sequence. For the sequence above, the n-level differences are given below:
S_{n}: | 1 | 3 | 10 | 26 | 55 | 101 | 168 | 260 … |
1st level differences: | 2 | 7 | 16 | 29 | 46 | 67 | 92 … | |
2nd level differences: | 5 | 9 | 13 | 17 | 21 | 25 … | ||
3rd level differences: | 4 | 4 | 4 | 4 | 4 … |
Notice that after the 3rd level differences are constant and the differences henceforth are 0. Therefore, the polynomial model for our sequence S_{n} is a third-degree polynomial.
The nth level differences themselves are a sequence. The first level differences is a sequence of a 2nd degree polynomial. The 2nd level differences is an arithmetic sequence. And finally, the 3rd level differences is a constant sequence.
But what we are concerned with is the first terms of each level of differences. The question is: How do the initial terms of the n-level differences affect the model of S_{n}? In order to expose the effect of the initial terms of n-level differences, we build a general sequence which covers sequence of every degree. But, we will be writing our sequence in a different way as shown in the table below.
Table 1: The General Polynomial sequence
0 | 1 | 2 | 3 | 4 | |
0 | K_{0} | K_{1} | K_{2} | K_{3} | K_{4} |
1 | K_{0} | K_{1} + 1K_{0} | K_{2} + K_{1} | K_{3} + K_{2} | K_{4} + K_{3} |
2 | K_{0} | K_{1} + 2K_{0} | K_{2} + 2K_{1} + K_{0} | K_{3} + 2K_{2} + K_{1} | K_{4} + 2K_{3} + K_{2} |
3 | K_{0} | K_{1} + 3K_{0} | K_{2} + 3K_{1} + 3K_{0} | K_{3} + 3K_{2} + 3K_{1} + K_{0} | K_{4} + 3K_{3} + 3K_{2} + K_{1} |
4 | K_{0} | K_{1} + 4K_{0} | K_{2} + 4K_{1} + 6K_{0} | K_{3} + 4K_{2} + 6K_{1} + 4K_{0} | K_{4} + 4K_{3} + 6K_{2} + 4K_{1} + K_{0} |
5 | K_{0} | K_{1} + 5K_{0} | K_{2} + 5K_{1} + 10K_{0} | K_{3} + 5K_{2} + 10K_{1} + 10K_{0} | K_{4} + 5K_{3} + 10K_{2} + 10K_{1} + 5K_{0} |
6 | K_{0} | K_{1} + 6K_{0} | K_{2} + 6K_{1} + 15K_{0} | K_{3} + 6K_{2} + 15K_{1} + 20K_{0} | K_{4} + 6K_{3} + 15K_{2} + 20K_{1} + 15K_{0} |
7 | K_{0} | K_{1} + 7K_{0} | K_{2} + 7K_{1} + 21K_{0} | K_{3} + 7K_{2} + 21K_{1} + 35K_{0} | K_{4} + 7K_{3} + 21K_{2} + 35K_{1} + 35K_{0} |
8 | K_{0} | K_{1} + 8K_{0} | K_{2} + 8K_{1} + 28K_{0} | K_{3} + 8K_{2} + 28K_{1} + 56K_{0} | K_{4} + 8K_{3} + 28K_{2} + 56K_{1} + 70K_{0} |
9 | K_{0} | K_{1} + 9K_{0} | K_{2} + 9K_{1} + 36K_{0} | K_{3} + 9K_{2} + 36K_{1} + 84K_{0} | K_{4} + 9K_{3} + 36K_{2} + 84K_{1} + 126K_{0} |
10 | K_{0} | K_{1} + 10K_{0} | K_{2} + 10K_{1} + 45K_{0} | K_{3} + 10K_{2} + 45K_{1} + 120K_{0} | K_{4} + 10K_{3} + 45K_{2} + 120K_{1} + 210K_{0} |
In this table, the numbers in the first row represent the degree of polynomial: 0, 1, 2, 3, 4, and so on. The numbers in the first column represent the nth term in the sequence.
So, we have a sequence in the Column 0, which are all K_{0}. The rule for the sequence in Column 0 would be a polynomial of 0 degree.
The sequence in Column 1 is: K_{1}, K_{1} + 1K_{0}, K_{1} + 2K_{0}, K_{1} + 3K_{0}, K_{1} + 4K_{0} K_{1} + 5K_{0}, ... K_{1} + nK_{0}. The nth term can be represented by the expression: \(K_1 + K_{0}n\).
The first level difference for the sequence in Column 1 is the sequence in Column 0!
Similarly, the sequence in Column 2 is: K_{2}, K_{2} + K_{1}, K_{2} + 2K_{1} + K_{0}, K_{2} + 3K_{1} + 3K_{0}, K_{2} + 4K_{1} + 6K_{0}, ... and so no. The nth term in this sequence is given by\(K_2 + K_{1}n + K_{0}\frac{n(n-1)}{2}\).
And the 1st level difference for sequence in Column 2 is Column 1 and the 2nd level difference is Column 0!
Hence, with our table, we can represent any polynominal sequence. And the coefficients are basically the numbers in Pascal’s triangle.
Remember we were interested in how the first terms in the nth level differences compute in our formula for the rule for the sequence. Well, Row 0 represents our first terms in the nth level differences, since the sequence progresses downward.
We have five sequences progressing downward in the 5 columns marked 0 to 4.
Because the pattern is obvious, meaning that the coefficients are Pascal’s triangle numbers, we can derive a model for any term that is located in a specific column and row:
A polymonial sequence can be represented by the following formula:
\(f(n)=K_{i}+ \frac{K_{i-1}}{1!}n+ \frac{K_{i-2}}{2!}n(n-1)+\) \(\frac{K_{i-3}}{3!}n(n-1)(n-2)+\) \(\frac{K_{i-4}}{4!}n(n-1)(n-2)(n-3)+...\)
where K_{i} represent the first terms of the nth level differences.
The model f(n) for the polynomial sequence above has 2 terms if the sequence is arithmetic, 3 terms if the sequence is quadratic, 4 terms if the sequence is cubic, and so on.
Our method is simple. We continue to find the differences until they become 0’s. Then we take the first terms in the differences (excluding the 0) to be the coefficients in our model above. We can illustrate with an example.
Example 1
For our sequence above: 1, 3, 10, 26, 55, 101, 168, 260, …, K_{3} = 1, K_{2} = 2, K_{1} = 5, K_{0} = 4. Hence, we have:
\(f(n)= 1+\frac{2}{1!}n+\frac{5}{2!}n(n-1)+ \) \(\frac{4}{3!}n(n-1)(n-2) = \) \(1+2n+\frac{5}{2}n(n-1)+\) \(\frac{2}{3}n(n-1)(n-2)\)
It is a bit of work to expand this in polymonial form; however, when simplifying we get: \(f(n)= 1+\frac{5}{6}n+\frac{1}{2}n^2+\frac{2}{3}n^3\).
Let’s check with n = 6: \(f(6)= 1+\frac{5}{6}(6)+\frac{1}{2}(6^2)+\frac{2}{3}(6^3) = 1 + 5 + 18 + 144 = 168\). And the 7th term is indeed 168. Remember that \(f(0)\) is the first term.
Example 2
Let’s work backward with a given polynomial (since there’s hardly a chance we come across a sequence we need to find the formula for). Suppose our polymonial is \(f(n) = n^4 - 2n^3 + 3n^2 - 4n + 5\). The first few terms of the sequence, S_{n}, produced by this polynomial are:
(i) S_{n} = 5, 3, 9, 47, 165, 435, 953, 1839, 3237, 5315, 8265, ...
Now, let’s find the difference until they are constant.
1st: –2, 6, 38, 118, 270, 518, 886, 1398, 2078, 2950, ...
2nd: 8, 32, 80, 152, 248, 368, 512, 680, 872, ...
3rd: 24, 48, 72, 96, 120, 144, 168, 192, ...
The 3rd level is quite a surprise, revealing the even multiples of 12. We expect the 4th level differences to be constant since our polynomial was 4th degree.
4th: 24, 24, 24, 24, 24, 24, 24, ...
And indeed, the 4th level differnces are a constant 24. Now, the first terms of the differences are 5, –2, 8, 24, and 24. Remember to include 5 from the original series itself. So, our model for this sequence is:
(ii) \(f(n)=5 - 2n + \frac{8}{2!}n(n-1)+\) \(\frac{24}{3!}n(n-1)(n-2)+\) \(\frac{24}{4!}n(n-1)(n-2)(n-3)\)
(iii) \(f(n)=5 - 2n + 4n^2 - 4n+\) \(4n^3-12n^2+8n+\) \(n^4-6n^3+11n^2-6n\)
Equation (ii) actually does reduce to \(f(n) = n^4 - 2n^3 + 3n^2 - 4n + 5\).
Sum of the Power Series
The above discussion has been about sequences and not sums. However, we are actually dealing with sums when we compare the (n – 1)th level differences with the nth level differences, meaning that the 2nd level differences would be the sums of the 3rd level differences, since we found the 3rd level differences by substracting.
We can find a formula for the sum of the powers of integers, \(\sum_{i}^{n}i^k\), by writing our sum of the first n terms as a sequence, then finding the nth level differences. We only need to find the coefficients (K_{i}, K_{i}_{–1}, K_{i}_{–2}, K_{i}_{–3}, …) and make the proper substitution. The coefficients are the initial terms of the n-level differences.
Table 2: The 1st term of nth-Level Differences for a Power Series
f(n) | 1st term of nth–level diff. = K_{i} |
1^{x} | 2^{x} |
1^{x} + 2^{x} | 3^{x} – 2^{x} |
1^{x} + 2^{x} + 3^{x} | 4^{x} – 2×3^{x} + 2^{x} |
1^{x} + 2^{x} + 3^{x} + 4^{x} | 5^{x} – 3×4^{x} + 3×3^{x} – 2^{x} |
1^{x} + 2^{x} + 3^{x} + 4^{x} + 5^{x} | 6^{x} – 4×5^{x} + 6×4^{x} – 4×3^{x} + 2^{x} |
1^{x} + 2^{x} + 3^{x} + 4^{x} + 5^{x} + 6^{x} | 7^{x} – 5×6^{x} + 10×5^{x} – 10×4^{x} + 5×3^{x} – 2^{x} |
1^{x} + 2^{x} + 3^{x} + 4^{x} + 5^{x} + 6^{x} + 7^{x} | 8^{x} – 6×7^{x} + 15×6^{x} – 20×5^{x} + 15×4^{x} – 6×3^{x} + 2^{x} |
1^{x} + 2^{x} + 3^{x} + 4^{x} + 5^{x} + 6^{x} + 7^{x} + 8^{x} | 9^{x} – 7×8^{x} + 21×7^{x} – 35×6^{x} + 35×5^{x} – 21×4^{x} + 7×3^{x} – 2^{x} |
Our sums sequence, or a series, progresses downward in the first column. The second column are the differences. The pattern becomes obvioius. Pascal’s triangle appears in the 1st-level differences as we would have expected.
We have been evaluating the first term of the sequence with n = 0 in our sequences above, but we will shift to n = 1 because our first sum will be 1. Substituting in the model, we have:
The sum of the power series is given by the formula:
(1) \(\displaystyle \sum_{i=1}^{n}i^x = 1+\frac{2^x}{1!}(n-1)+\) \(\displaystyle \frac{3^x-2^x}{2!}(n-1)(n-2)+\) \(\displaystyle \frac{4^x-2\cdot 3^x+2^x}{3!}(n-1)(n-2)(n-3)+\) \(\displaystyle \frac{5^x-3\cdot4^x+3\cdot3^x-2^x}{4!}(n-1)(n-2)(n-3)(n-4)+...\)
Of course, this formula is not simple if one tries to expand it, and we have to work quite a bit to evaluate the coefficients. But, the series does not require knowing Bernoulli numbers and there’s a pattern in the formula. Also, the series terminates to 3 terms when we are summing i, 4 terms when summing i^{2}, 5 terms when summing i^{3}, and so on. If the formula is left as it without expanding the terms and simplifying, we do have a good formula.
We will evaluate equation (1) now and derive the formulas for the first few powers.
The Sum of the Powers Formulas
x = 0
We will evaluate the formulas of the first few power series. When x = 0, we have the simple series of 1’s:
(i) \(\sum_{i=1}^{n}i^0 = \sum_{i=1}^{n} 1 = 1+\frac{2^0}{1!}(n-1)+\) \(\frac{3^0-2^0}{2!}(n-1)(n-2)+\) \(\frac{4^0-2\cdot 3^0+2^0}{3!}(n-1)(n-2)(n-3)+\) \(\frac{5^0-3\cdot4^0+3\cdot3^0-2^0}{4!}(n-1)(n-2)(n-3)(n-4)+... \)
(ii) \(\sum_{i=1}^{n} 1 = 1 + \frac{1}{1!}(n-1)+\) \(\frac{1-1}{2!}(n-1)(n-2)+\) \(\frac{1-2+1}{3!}(n-1)(n-2)(n-3)+\) \(\frac{1-3+3-1}{4!}(n-1)(n-2)(n-3)(n-4)+...\)
(iii) \(\sum_{i=1}^{n} 1 = 1 + n - 1\)
(1) \(\sum_{i=1}^{n} 1 = n \)
That was a bit silly. Let’s march forward for the higher powers.
x = 1
When x = 1, our formula should reduce to the triangular numbers formula:
(i) \(\sum_{i=1}^{n}i^1 = 1+\frac{2^1}{1!}(n-1)+\) \(\frac{3^1-2^1}{2!}(n-1)(n-2)+\) \(\frac{4^1-2\cdot 3^1+2^1}{3!}(n-1)(n-2)(n-3)+\) \(\frac{5^1-3\cdot4^1+3\cdot3^1-2^1}{4!}(n-1)(n-2)(n-3)(n-4)+...\)
(ii) \(\sum_{i=1}^{n}i = 1+2(n-1)+\) \(\frac{1}{2}(n-1)(n-2)+\) \(\frac{4-6+2}{3!}(n-1)(n-2)(n-3)+\) \(\frac{5-12+9-2}{4!}(n-1)(n-2)(n-3)(n-4)+...\)
(iii) \(\sum_{i=1}^{n}i = 1+2n-2+\) \(\frac{1}{2}n^2-\frac{3}{2}n+1\)
(2) \(\sum_{i=1}^{n}i = \frac{1}{2}n^2+\frac{1}{2}n = \frac{n(n+1)}{2}\)
Equation (2) is indeed the formula for the triangular numbers.
x = 2
(i) \(\sum_{i=1}^{n}i^2 = 1+\frac{2^2}{1!}(n-1)+\) \(\frac{3^2-2^2}{2!}(n-1)(n-2)+\) \(\frac{4^2-2\cdot 3^2+2^2}{3!}(n-1)(n-2)(n-3)+\) \(\frac{5^2-3\cdot4^2+3\cdot3^2-2^2}{4!}(n-1)(n-2)(n-3)(n-4)+...\)
(ii) \(\sum_{i=1}^{n}i^2 = 1+4(n-1)+\) \(\frac{5}{2}(n-1)(n-2)+\) \(\frac{1}{3}(n-1)(n-2)(n-3)+\) \(\frac{25-48+27-4}{4!}(n-1)(n-2)(n-3)(n-4)+...\)
(iii) \(\sum_{i=1}^{n}i^2 = 1 + 4n - 4 +\) \(\frac{5}{2}n^2 - \frac{15}{2}n + 5 +\) \(\frac{1}{3}(n^3-6n^2+11n-6)\)
(3) \(\sum_{i=1}^{n}i^2 = \frac{1}{3}n^3 + \frac{1}{2}n^2+\frac{1}{6}n = \) \(\frac{1}{6}n(n+1)(2n+1)\)
Shall we check with the sum of the first 10 squares?
Per WolframAlpha, \(\sum_{i=1}^{10}i^2 = 385\). Using our formula, we get \(\frac{1}{6}(10)(11)(21) = \frac{2310}{6} = 385\). Well... we knew this would work since these formulas are well-known.
As the power increases, carrying out the expansion and simplication gets more and more complex. At some point, it is better to leave the formula as is and only compute the coefficients. We will find the expanded form for a few more.
x = 3
The sum of this sequence is well known to be the squares of triangular numbers. We will add an extra term to make sure it evaluates to 0.
(i) \(\sum_{i=1}^{n}i^3 = 1 + \frac{2^3}{1!}(n-1)+\) \(\frac{3^3-2^3}{2!}(n-1)(n-2)+\) \(\frac{4^3-2\cdot 3^3+2^3}{3!}(n-1)(n-2)(n-3)+\) \(\frac{5^3-3\cdot4^3+3\cdot3^3-2^3}{4!}(n-1)(n-2)(n-3)(n-4)+ \) \(\frac{6^3-4\cdot5^3+6\cdot4^3-4\cdot3^3+2^3}{5!}(n-1)(n-2)(n-3)(n-4)(n-5)+...\)
(ii) \(\sum_{i=1}^{n}i^3 = 1 + 8(n-1)+\) \(\frac{19}{2}(n-1)(n-2)+\) \(3(n-1)(n-2)(n-3)+\) \(\frac{1}{4}(n-1)(n-2)(n-3)(n-4)+ \) \((0)(n-1)(n-2)(n-3)(n-4)(n-5)+...\)
(iii) \(\sum_{i=1}^{n}i^3 = 1 + 8n - 8 +\) \(\frac{19}{2}(n-1)(n-2)+\) \(3(n-1)(n-2)(n-3)+\) \(\frac{1}{4}(n-1)(n-2)(n-3)(n-4)\)
(4) \(\sum_{i=1}^{n}i^3 = \frac{1}{4}n^2(n+1)^2 = \left( \frac{n(n+1)}{2} \right)^2\)
x = 4
(i) \(\sum_{i=1}^{n}i^4 = 1 + \frac{2^4}{1!}(n-1)+\) \(\frac{3^4-2^4}{2!}(n-1)(n-2)+\) \(\frac{4^4-2\cdot 3^4+2^4}{3!}(n-1)(n-2)(n-3)+\) \(\frac{5^4-3\cdot4^4+3\cdot3^4-2^4}{4!}(n-1)(n-2)(n-3)(n-4)+ \) \(\frac{6^4-4\cdot5^4+6\cdot4^4-4\cdot3^4+2^4}{5!}(n-1)(n-2)(n-3)(n-4)(n-5)\)
(ii) \(\sum_{i=1}^{n}i^4 = 1 + 16(n-1)+\) \(\frac{65}{2}(n-1)(n-2)+\) \(\frac{55}{3}(n-1)(n-2)(n-3)+\) \(\frac{7}{2}(n-1)(n-2)(n-3)(n-4)+ \) \(\frac{1}{5}(n-1)(n-2)(n-3)(n-4)(n-5)\)
(5) \(\sum_{i=1}^{n}i^4 = \frac{n^5}{5}+\frac{n^4}{2}+\frac{n^3}{3}-\frac{n}{30} = \) \(\frac{1}{30}n(n+1)(2n+1)(3n^3+3n-1)\)
Let’s check the formula in (ii) for n = 7.
(iii) \(\sum_{i=1}^{7}i^4 = 1 + 16(7-1)+\) \(\frac{65}{2}(7-1)(7-2)+\) \(\frac{55}{3}(7-1)(7-2)(7-3)+\) \(\frac{7}{2}(7-1)(7-2)(7-3)(7-4)+ \) \(\frac{1}{5}(7-1)(7-2)(7-3)(7-4)(7-5)\)
(iv) \(\sum_{i=1}^{7}i^4 = 1 + (16)(6)+\) \(\frac{65}{2}(6)(5)+\) \(\frac{55}{3}(6)(5)(4)+\) \(\frac{7}{2}(6)(5)(4)(3)+ \) \(\frac{1}{5}(6)(5)(4)(3)(2)\)
(v) \(\sum_{i=1}^{7}i^4 = 1 + 96 + 975 + 2200 + 1260 + 144 = 4676\)
WolframAlpha gives the same result.
x = 5
(i) \(\sum_{i=1}^{n}i^5 = 1+\frac{2^5}{1!}(n-1)+\) \(\frac{3^5-2^5}{2!}(n-1)(n-2)+\) \(\frac{4^5-2\cdot 3^5+2^5}{3!}(n-1)(n-2)(n-3)+\) \(\frac{5^5-3\cdot4^5+3\cdot3^5-2^5}{4!}(n-1)(n-2)(n-3)(n-4)+\) \(\frac{6^5-4\cdot5^5+6\cdot4^5-4\cdot3^5+2^5}{5!}(n-1)(n-2)(n-3)(n-4)(n-5) + \) \(\frac{7^5-5\cdot6^5+10\cdot5^5-10\cdot4^5+5\cdot3^5-2^5}{6!}(n-1)(n-2)(n-3)(n-4)(n-5)(n-6)\)
(ii) \(\sum_{i=1}^{n}i^5 = 1 + 32(n-1)+\) \(\frac{211}{2}(n-1)(n-2)+\) \(95(n-1)(n-2)(n-3)+\) \(\frac{375}{12}(n-1)(n-2)(n-3)(n-4)+\) \(4(n-1)(n-2)(n-3)(n-4)(n-5) + \) \(\frac{1}{6}(n-1)(n-2)(n-3)(n-4)(n-5)(n-6)\)
Expanding Equation (ii) is a task of its own. Rather, we will use it as is and find the sum of the first 4 terms. Notice that when n = 4, last two terms equal 0, so not all terms come into play. Then we will sum the first 8 terms.
(iii) \(\sum_{i=1}^{4}i^5 = 1 + 32(3)+\) \(\frac{211}{2}(3)(2)+\) \(95(3)(2)(1)+\) \(\frac{375}{12}(3)(2)(1)(0)+\) \(4(3)(2)(1)(0)(-1) + \) \(\frac{1}{6}(3)(2)(1)(0)(-1)(-2)\)
(iv) \(\sum_{i=1}^{4}i^5 = 1 + 96 + 633 + 570 = 1300\)
A quick check with WolframAlpha confirms the result. Now, let’s try n = 8.
(v) \(\sum_{i=1}^{8}i^5 = 1 + 32(7)+\) \(\frac{211}{2}(7)(6)+\) \(95(7)(6)(5)+\) \(\frac{375}{12}(7)(6)(5)(4)+\) \(4(7)(6)(5)(4)(3) + \) \(\frac{1}{6}(7)(6)(5)(4)(3)(2)\)
(v) \(\sum_{i=1}^{8}i^5 = 1 + 224 + 4431 + 19950 + 26250 + 10080 + 840 = 61776\)
Again, this confirms with Wolfram Alpha. The sum gets large quickly.
Pattern of Zeroes in the Coefficients
You may have notices that the coefficients evaluate to 0 for a certain number of powers before they produce a non-zero value. Visit this page to see the pattern: Power Series Sum Formula Coefficients and a Pattern of Zeros.