# Forming natural numbers with positive consecutive integers

I'm trying to prove that any natural number $$N$$ can be formed by adding at least two positive consecutive integers except for powers of $$2$$. For example, using $$\,N = 3$$, $$N = 1 + 2$$. When experimenting with different values for $$N$$, I found that the there are no positive consecutive integers that when summed together give a power of $$2$$.

Therefore, I was wondering how you could prove that a number in the form $$2^n$$ cannot be formed by adding at least two positive consecutive integers.

P.S. I started by proving that all odd numbers can be formed by adding two consecutive integers:

$$N=x+(x+1)\\N=2x+1$$

Suppose that there exists a set of three integers $(a,k,n)$ such that $$a+(a+1)+\cdots+(a+n-1)=2^k\tag1$$ where $a\gt 0,n\ge 2,k\ge 1$.

From $(1)$, we have $$n(2a+n-1)=2^{k+1}.$$

Since $n$ and $2a+n-1$ have different parity, we have two cases :

Case 1 : If $n=2^{k+1}$, then $a=1-2^k$ is negative, which contradicts $a\gt 0$.

Case 2 : If $2a+n-1=2^{k+1}$, then $n=1$, which contradicts $n\ge 2$.

Hence, there is no such $(a,k,n)$.

Hint:

The sum of $n$ consecutive integers starting from $k$ and ending at $n+k-1$ is given by $$\sum_{i=k}^{n+k-1} i = \frac{1}{2}n(2k+n-1)$$

Since $2k$ is even for every $k$, we need not consider the parity of $k$, instead, we need to consider a few other cases.