Friday, 8 November 2019

My Method for finding the Sums of Squares of Arithmetic Sequences


Over the last month, the most popular blog post visited was from December of 2012. In fact the top five in popularity were all from before 2013. Obviously I was a much better writer in the early years after my retirement, so over the next week or so, I will try to repost them all. Maybe I can do something similar next month if the "most popular" list changes. So here, from 21 Dec of 2012....A Christmas present from the past.
-------------------------------------------------------------------------------------------------------
Recently while reading Fibonacci's Liber Abaci about the sums of squares I mis-read that he had included a formula for finding the sum of the squares of integers in arithmetic sequence. He didn't; well he did, but only for select sequences that obeyed his special rule.

Fibonacci's rule for the sum of the squares of the first n integers was to the last term times the next term that would be in the sequence (if it was continued), and multiply these by their sum divided by 6. This produces the familiar \( 1^2+2^2+3^2+...+n^2\) = (n)(n+1)(2n+1)/6 which appears in all the textbooks.

Fibonacci went on to show that if you wanted to square the first n odd integers then the same rule would apply if we divide by an additional 2. That is\( 1^2+3^2+5^2+...+n^2\) = n(n+2)(2n+2)/(12).



He goes on to state that the same rule would work if you had multiples of 3 or 4 and divided by both 6 and the increment between terms. It was this part that I glibly misread to think that it applied to all arithmetic sequences. When I tried it out on a sequence, \(1^2+4^2+7^2\) I found that 7(10)(17) was not going to be divisible by 6x3. And when I tried other examples, they almost always failed, but on following up with the division it turned out that; although they were not exact, they were always very close.

The true value of the series of squares above turns out to be 66, and the result by my over extension of Fibonacci's rule leads to 66.11111.....

As long as the first term in the sequence was one, it seemed that the floor function of the result was the correct answer. For example, \(1^2+6^2+11^2+16^2 =414\)

Using 16(21)(37)/(6*5) = 414.4



If you started with a first term other than one, the results were undervalued. \(2^2+5^2+8^2 = 93\)  while the generalized rule would give 8(11)(19)/(6x3) = 92.8888...

\(3^2+7^2+11^2+15^2 = 404\), and the rule gives (15)(19)(34)/(6*4)= 403.75.



I thought I remembered that the early Hindu or Arabic or somebody scholars had a formula for that, but I wasn't sure if it was a simple rule or one developed too late for inclusion in the Liber Abaci, so I flipped open a pad and began to scribble out a little high school level algebra, and rather quickly (for an older guy) came up with what I thought was a somewhat pretty little method. I would later search out an answer not TOOOO different, but thought my notation was much superior for remembering, so here it is; Ballew's formula for the sum of the squares of integers in an arithmetic sequence.

Let F, L, d, and n represent the first term, last term, common difference, and number of terms of an arithmetic Sequence, then the sum of the Squares, S, is given by \(FLn + d^2 (n-1)n(2n-1)/6 \). Note the part after the addition sign is simply the sum of the squares of the first n-1 integers times the square of the common difference.



For the \(1^2+6^2+11^2+16^2 =414\)  we have n=4, d=5, F=1 and L=16. This gives \(4(1)(16)+ 5^2(3)(4)(7)/6 \)



If we started somewhere higher, \(25^2+31^2+37^2 +...+49^2= 7205\) Using n=5, d=6, F=25 and L=49 we get \((5)(25)(49)+6^2 (4)(5)(9)/6 \)= Yep, you guessed it, 7205.



Checking on the history of squaring arithmetic sequences, I found that as early as 850, Mahavira's Ganita Sara Sangraha contained a much more complicated formula :




The sum is given as 8065. Using my n=10, d= 5, F= 2 and L= 47 gives (10)(2)(47) + 25(9)(10)(19)/6 which is also 8065.



I did find another version somewhat later that was more similar to mine, but still not as nice (don't you agree?) in the work of Narayana Pandita from the 14th Century (perhaps you remember his problem of Cows and calves, something to write on later).



His result looks like this:



Note he also has the square of the difference on the right multiplied by the sum of n-1 squares.



Before I close on the topic, while scrolling through these old scholar's work I did find a really simple formula for the sum of the cubes of an arithmetic sequence.

The formula uses S as the sum of the simple arithmetic sequence. Today we might write S=n (F+L) /2 . The sum of the cubes of that sequence is given by \(S^2 + SF(F-d)\)



For the case of S= 2+5+ 8 + 11 = 26, and  \(2^3 + 5^ 3+8^3+11^3 = 1976\) the method says to use \(26^2+26(2)(-1) = 1976.\)



Note that for the natural sequence with a = 1 and d=1, the last term disappears to give \( S^2) which is the textbook formula.







No comments: