Tuesday, October 28, 2025

Sum of consecutive positive integers

 A classic.


Show that integers of the form $2^m$ are the only positive integers that cannot be written as the sum of two or more consecutive positive integers.

.

.

.

.

Solution:

Suppose we try to write $X$ as the sum of consecutive positive integers.

$$X =  a + (a+1) + \dots + (a+n)$$ 

i.e.

$$2X = (n+2a)(n+1)$$

Note, since we need two or more, we must have that $n > 0$, and $n + 2a > n+1$.

Note that $n+2a$ and $n+1$ are of different parities.

If $X$ was a power of $2$, then the only way we can factor $2X$ into factors of different parities is if one of them is $1$. But we have $n+1 \ge 2$. So, powers of $2$ cannot be written in that form.

For any other $X  = 2^m Y$ ($Y > 1$, odd), we can pick the factors to be $2^{m+1}$ and $Y$ and compute the appropriate $n$ and $a$.

No comments:

Post a Comment