### Sums of consecutive integers

#### by David Radcliffe

Some numbers can be written as the sum of two or more consecutive positive integers, and some cannot. For example, 15 can be expressed in three different ways: 7+8, 4+5+6, and 1+2+3+4+5. But it is not possible to express 8 in this way. This raises two interesting questions:

- Which numbers can be expressed as the sum of two or more consecutive positive integers?
- In how many ways can a given number be expressed as the sum of two or more consecutive positive integers?

These are excellent questions for students to investigate, and there have been many articles written about them. The NRICH website has a guide for using this problem in the classroom. I would like to offer a fresh perspective on the problem.

Generalization is one of the most powerful tools that are available to a mathematician. We can generalize the problem by allowing the integers in the sum to be negative or zero, and also by allowing the sum to consist of a single term. With this generalization, there are now 8 ways to write 15 as a sum of consecutive integers.

15 | −14 + … + 14 + 15 |

7 + 8 | −6 + … + 6 + 7 + 8 |

4 + 5 + 6 | −3 + … + 3 + 4 + 5 + 6 |

1 + 2 + 3 + 4 + 5 | 0 + 1 + 2 + 3 + 4 + 5 |

Let us examine this table closely. The first column lists the solutions whose terms are all positive, and the second column lists the solutions that have at least one non-positive term. These columns have the same length; in fact, there is a one-to-one correspondence between the two sets of solutions.

*A* + … + *B* ↔ (−*A*+1) + … + *B*

This transformation has another important property: it changes an expression having an even number of terms into an expression having an odd number of terms, and vice versa. This implies that half of the solutions have an even number of terms, and half of the solutions have an odd number of terms.

But if half of the solutions have an odd number of terms, and half of the solutions have only positive terms, then it follows that the number of solutions with positive terms is equal to the number of solutions with an odd number of terms.

It remains to count the solutions with an odd number of terms. If *N* is the sum of *d* consecutive integers, where *d* is odd, then the middle term must be *N/d*, hence *N/d* is an integer. Conversely, if *d* is odd and *N/d* is an integer, then the sum of *d* consecutive integers centered at *N/d* is equal to *N*. Therefore, the number of ways to write *N* as the sum of an odd number of consecutive integers is equal to the number of odd positive divisors of *N*.

Consider the prime factorization of *N*

where *p _{n}* denotes the

*n*th prime (so

*p*

_{1}= 2). Every odd divisor

*d*of

*N*can be written as

where 0 ≤ *a _{i}* ≤

*e*for all

_{i}*i*between 2 and

*k*. Therefore, the number of odd divisors of

*N*is equal to

since there are (1 + *e _{i}*) choices for each exponent

*a*in the prime factorization of

_{i}*d*.

**Example 1: **In how many ways can 1024 be expressed as the sum of two or more consecutive positive integers?

**Solution: **Since 1024 is a power of two, it has only one odd divisor (namely 1). Therefore, it is not possible to write 1024 as the sum of two or more consecutive positive integers.

**Example 2 :** In how many ways can 600 be expressed as the sum of two or more consecutive positive integers?

**Solution:** By the preceding discussion, this is equal to the number of odd divisors of 600, minus one (to eliminate the trivial solution with one term.) The prime factorization of 600 is

and the number of odd divisors of 600 is (1+1)*(1+2) = 6. Therefore, there are 5 ways to write 600 as the sum of two or more consecutive positive integers.

**Example 3:** What is the smallest number that can be written as the sum of two or more consecutive integers in exactly 1000 ways?

**Solution: **This is left as a challenge to the reader.

*Note:* Nick Hobson arrived at a similar solution independently.

This is my all-time favourite maths problem! I shared it at MathsJam yesterday but I’ve never explored the inclusion of negative numbers, so thanks for giving me an excuse to sink myself in an old favourite once again and make some new discoveries!

But in Example 2, it’s not true that 600 has 6 ways of being expressed as the sum of consecutive ‘positive’ numbers because when there are 75 integers adding up to become 600 and their average is 8, there is simply no way that they would all be positive, leave alone possible

But if you include negative numbers it is possible:-29,-28,…0.1,2,…29,30,…45, the sum=600.

So also 30,31,…45 has sum of 600.

When the last number in the row is n and the first is k, the sum S=(n^2+n-(k^2+k))/2, or (n^2-k^2)-(n-k)=(n-k)(n+k+1)=2S.

In this expression the parity of n-k and n+k+1 are different, so even and odd, or odd and even.

Write 2S as the product of an odd and an even factor. The smaales of the two is the length of the row (n-k)

If S=600, we have 122=75*16, so the length of the row can be 16.

There are six ways to express 600 as the sum of (one or more) consecutive positive integers:

600

199+200+201

118+119+120+121+122

33+…+47

12+…+36

30+…+45

The list of ways to write 600 as the sum of an odd number of conscutive integers is the same, except that 30+…+45 is replaced with -29+…+45. This may help to illustrate the bijection between the two types of representations.

15^9 for the challenge