### Sums of consecutive integers

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:

1. Which numbers can be expressed as the sum of two or more consecutive positive integers?
2. 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 pn denotes the nth prime (so p1 = 2). Every odd divisor d of N can be written as

where 0 ≤ ai ≤ ei for all i between 2 and k. Therefore, the number of odd divisors of N is equal to

since there are (1 + ei) choices for each exponent ai in the prime factorization of 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.