Sum of Consecutive Odd IntegersDate: 07/27/2001 at 05:13:33 From: Hooji F. Rubie Subject: Number as a sum of consecutive odd integers? Given an integer N, I would like to know if N can be written as a sum of consecutive odd integers. If so, how can I identify *all* the sets of consecutive odd integers that add up to N? Date: 07/27/2001 at 16:20:28 From: Doctor Greenie Subject: Re: Number as a sum of consecutive odd integers? Hello, Hooji - Thanks for sending your problem to us here at Dr. Math. I got some good mental exercise and a great deal of enjoyment out of investigating the problem and coming up with an answer! You perhaps know that the sum of the first n odd integers is n^2: 1 + 3 + 5 + ... + (2n-1) = n^2 From this, we have that the sum of any sequence of consecutive odd integers is (2m+1) + (2m+3) + ... + (2n-1) = [1 + 3 + 5 + ... + (2n-1)] - [1 + 3 + 5 + ... + (2m-1)] = n^2 - m^2 So the sum of any sequence of consecutive odd integers is a number that can be written as the difference of squares. Notice that we can come up with the preceding result using words, without the formal math: The sum of all the odd integers from the (m+1)st odd integer to the n-th odd integer is equal to the sum of all the odd integers from 1 to the n-th odd integer, minus the sum of all the odd integers from 1 to the m-th odd integer; but the sum of the first n odd integers is n^2 and the sum of the first m integers is m^2, so the sum of all the odd integers from the (m+1)st odd integer to the n-th odd integer is just n^2 minus m^2. Now we know that n^2 - m^2 = (n+m)(n-m) So an integer k can be written as the sum of consecutive odd integers if it can be expressed as k = ab where a = n+m (1) and b = n-m (2) Now, if n and m are integers, and if equations (1) and (2) are true, then we have a+b = 2n or n = (a+b)/2 (3) and a-b = 2m or m = (a-b)/2 (4) Because n and m are integers, these equations (3) and (4) tell us that a and b are either both even or both odd. So, now, we finally have our conclusion: An integer k can be written as the sum of consecutive odd integers if it can be expressed as k = ab where a and b are both even or both odd. Moreover, the sequence of odd integers with that sum is the (m+1)st odd integer through the n-th odd integer, where m and n are as given by equations (3) and (4). So... Here is the method for finding a sequence of consecutive odd integers whose sum is some integer k: (1) factor k as (a)(b), where a and b are either both even or both odd (assume, without loss of generality, that a is greater than or equal to b) (2) determine m = (a-b)/2 and n = (a+b)/2 (3) the first odd number in the sequence is the (m+1)st odd number, which is 2(m+1)-1; the last odd number in the sequence is the n-th odd number, which is 2n-1 Let's try a few numbers... k = 5: (1) 5 = 5*1 (2) n = (5+1)/2 = 3; m = (5-1)/2 = 2 (3) the first odd number in the sequence is the (m+1)st = 3rd odd number, which is 5; the last odd number in the sequence is the n-th = 3rd odd number, which is 5. We have the trivial solution: 5 = 5 (the sum of a sequence of odd integers containing a single entry). (If you examine the method for finding the sequences of integers, you will find this will always be the case if the factorization of k is k*1.) k = 15: (1) 15 = 15*1 (Similar to the previous example, this factorization of 15 will give us the trivial solution consisting of the single odd integer, 15....) Let's try k = 15 with a different factorization: (1) 15 = 5*3 (2) n = (5+3)/2 = 4; m = (5-3)/2 = 1 (3) the first odd integer in the sequence is the (m+1)st = 2nd odd number, which is 3; the last odd integer in the sequence is the n-th = 4th odd number, which is 7. We have the solution 15 = 3+5+7. k = 10: There are two ways to write 10 as the product of two factors: 10 = 10*1 10 = 5*2 Both of these factorizations fail to satisfy our requirement that the two factors be either both even or both odd. We can conclude that there is no sum of consecutive odd integers whose sum is 10. A bit of playing around will show that an integer will have several representations as the sum of a sequence of consecutive odd integers if the prime representation of the integer has many factors. Let's look at the example of 120, whose prime factorization is 2*2*2*3*5. Here are all the ways of writing 120 as the product of two integers: (a) 120*1 (b) 60*2 (c) 40*3 (d) 30*4 (e) 24*5 (f) 20*6 (g) 15*8 (h) 12*10 Of these factorizations, (a), (c), (e), and (g) do not meet our criterion of having either both factors even or both odd. The factorizations (b), (d), (f), and (h) should give us sequences of consecutive odd integers whose sum is 120. Let's continue using our method to find these sequences. (b) 120 = 60*2.... (1) a = 60; b = 2 (2) n = 31; m = 29 (3) 1st odd integer is 2(30)-1 = 59; last is 2(31)-1 = 61 120 = 59+61 (d) 120 = 30*4.... (1) a = 30; b = 4 (2) n = 17; m = 13 (3) 1st odd integer is 2(14)-1 = 27; last is 2(17)-1 = 33 120 = 27+29+31+33 (f) 120 = 20*6.... (1) a = 20; b = 6 (2) n = 13; m = 7 (3) 1st odd integer is 2(8)-1 = 15; last is 2(13)-1 = 25 120 = 15+17+19+21+23+25 (h) 120 = 12*10 (1) a = 12; b = 10 (2) n = 11; m = 1 (3) 1st odd integer is 2(2)-1 = 3; last is 2(11)-1 = 21 120 = 3+5+7+9+11+13+15+17+19+21 Thanks again for the question. Please write back if there is anything about my response that you do not understand, or if you have any further questions about this problem. - Doctor Greenie, The Math Forum http://mathforum.org/dr.math/ |
Search the Dr. Math Library: |
[Privacy Policy] [Terms of Use]
Ask Dr. Math^{TM}
© 1994-2013 The Math Forum
http://mathforum.org/dr.math/