This is a perfect extension for some of the problems I’m giving a test over tomorrow, so it caught my eye.
How many ways can 1000 be expressed as the sum of consecutive integers?
My first instinct was to start writing equations to find the sum of a set of consecutive integers with x as the least. I began with . This simplifies to but the solution is not an integer so there are not two consecutive integers that add to 10001.
To test four integers we’d use the equation . And suddenly infinity starts to dawn on us as we realize there could be a lot checking to be done. So back to equations and formulas. I looked at a set of simplified equations
and is .
To simplify the second term where and the total should be 6, I’ll use the formula . So for , it checks out.
Knowing that all the equations have the form 2 is useful. Solving for we get . We can now test (n) different consecutive integers to find the starting integer (x). In cases where both x and n are integral we have a solution, count the solutions and the problem is solved.
To count the solutions I wrote up a spreadsheet with three columns, a column for values of n, values of (1000 – (n^2-n)/(2))/n, and a simple column that would take the value of the second column formatted with
which holds “solution” only when the value of 1000-(x… is an integer.
I found 6 solutions: 5 consecutive integers (starting with 198: 198, 199, 200, 201, 202), 16 (starting with 55), 25 (starting with 28), 80 (starting with -27), 125 (starting with -54) , and 400 (starting with -197). After checking to see if there are more, I find a 7th solution with 2000 consecutive integers starting with -999 – it checks out .
So I guess I’m starting to wonder whether you couldn’t find an infinite number of solutions. Here’s a similar spreadsheet I cooked up on Google Spreadsheet. On excel I’ve checked up to about 13,000 consecutives and still not found any other solutions…
I also thought I noticed a pattern in the solutions that they were expanding by multiples of 5 so first there were 5 then 16 (doesn’t fit) then 80, then 400, then 2000… so I checked 10,000 consecutives, and found that there is not an integral starting point. So much for the pattern of fives.
My final answer is 7 sets of consecutive integers add up to 1000. And I wonder if there’s an easier way.