Difference of Squares


The following is based on the fact that a perfect square can be generated by adding odd numbers in a series starting from 1. 1+3+5+7+9+11 = 36. Since there are 6 summands the number is 62. Since sigmas are hard to make in html I will use the following notation to indicate the sum of a series:

sumk=1[2k-1]n = n2

Partial sums of arithmetic series adhere to the formula: (n/2)[2a1 + (n-1)d], where
n = the number of terms
a1 = the first term
d = the difference between terms
since in our quest d=2 the formula reduces to n[a1 + (n-1)] or n2 + (a1 - 1)n

Example: 9+11+13+15+17+19+21, n=7, a1=9
72+(9-1)(7) = 49+56 = 105

Now we can demonstrate that 105 = (7)(15), there are 7 terms and the middle term is 15
and 105 = 112 - 42 = 121-16 = 105

42=1+3+5+7
112=1+3+5+7+9+ 11+13+15+17+19+21
112-42=9+ 11+13+15+17+19+21

105 is also equal to (5)(21) or 132 - 82 = 169 - 64
17+19+21+23+25 = 105

To generate the difference series when the squares are known:
example: 562 - 332, since 2k-1, k=56 will determine the last term, 111
the first term is 2 plus the last term of the small square, k=33, 2k-1 + 2 = 67.
67+69+71+73+75+77+79+81+83+85+87+89+91+93+95+97+99+101+103+105+107+109+111
there are 2 ways to determine n, 56 - 33 = 23 = n or [(111 - 67)/2] + 1 = 23 = n
plugging into our sum formula we get sumk=34[2k-1]56 = 232 + (67 - 1)23 = 529 + 1518 = 2047 = (23)(89)