Proving any number of the form $2^n$ can't be written as the sum of k consecutive numbers. I think i have proved that any number of the form $2^n$ can't be written as the sum of k consecutive positive integers, but i would be grateful if i could have some clarification as to whether this is a correct and valid proof or not.
Let $g=x+(x+1)+(x+2)+(x+3)+...+(x+(k-1))$, hence g is the sum of k consecutive positive integers.
$g=kx+\sum_{d=1}^{k-1}d$
Hence, $g=kx+\frac{k(k-1)}{2}$
Rearranging for x we find, $x=\frac{g}{k}-\frac{(k-1)}{2}$
So, for certain values of $k$, we can be sure that a positive integer value of $x$ can be found, and hence $g$ can be written as the sum of $k$ consecutive positive integers.There are two cases for $k$ to considor:
Case 1)
$k$ is odd. If $x$ exists, it must be the case $k$ | $g$, as for odd values of $k$, $\frac{(k-1)}{2}$ will alwyas be an integer, and hence $x$ will.
Case 2)
$k$ is even. $k$ does not divide $g$, but $\frac{g}{k}$ must be a multiple of $\frac{1}{2}$, and hence equals $\frac{h}{2}$, for some odd $h$.
Letting $j=2^n$, assume that we can write $j$ as the sum of $k$ consecutive positive integers.
If $k$ is odd, then if a $k$ exists, it must divide $j$, by Case 1. But, $j$ has no odd factors as it is a power of two, hence $k$ could not be odd.
If $k$ is even, by Case 2 it mut be the case $k$ does not divide $j$. Also, $\frac{j}{k}=\frac{h}{2}$, for some odd $h$.
But, this implies $2j$ has an odd factor, $h$. but, as $2j$ is a power of $2$, it can't have odd factors. So, $k$ can't be odd.
Hence, $k$ is neither odd or even, and this is a contradiction to our assumption. Hence no $x$ exists, and hence and number of the form $2^n$ can't be written as the sum of $k$ consecutive positive integers.
Any feedback on this proof would be appreciated.
 A: It is a bit slicker to do it in the other direction: Instead of starting with $g$ and looking for a way to write it as the sum of consecutive integers, start by a sum of $k\ge 2$ consecutive integers and show that its sum cannot be a power of two.
We use the general fact that the sum of a finite arithmetic sequence is
$$ (\text{number of terms})\frac{(\text{first term})+(\text{last term})}{2} $$
If there's an odd number of terms ($\ge 3$), then the first factor of this is divisible by some odd prime, and dividing by $2$ at the end cannot make that go away. So the sum is divisible by the same odd prime, and is not a power of $2$.
If there's an even number of terms, then exactly one of the first and last terms will be odd. So the numerator in the fraction above is odd, and is divisible by an odd prime; like before this odd prime will divide the entire expression.
A: $Theorem$ -For any natural number $n$ , the number of ways it can be written as a sum of consecutive integers (more than 1) is 1 less than the number of odd factors.
Proof-
Note that For every odd factor , say $k$, that a number has, it can be written as a sum of $k$ consecutive integers.
In fact, the number $n$ can be written as product of the number of summands ,$k$ and the middle term of the sum.Also, these sums are unique.
A sum may have either an even or an odd number of terms.
We are through with the odd number of terms.
Now, we can also relate the sums with even number of terms to the sums created by odd number of terms.
Say we have a sum $a+(a+1)+(a+2)+\cdots +(a+x)$ ,$(a>0)$, we can rewrite it as
$-(a-1)-(a-2) -\cdots -1 +0+1+\cdots +a+(a+1)+\cdots (a+x)$
which will have an even number of terms. Same can be done if $a>0$ and sum has even terms
Now, observe that every odd factor will produce a unique sum (i.e. a sum cannot be shortened into another).
So, we have proven the theorem.

Coming back to your question, observe that any power of 2 has only 1 odd factor, namely"1". Using the theorem proved above, we can say that $2^n$ cannot be written as sum of consecutive integers
$\blacksquare$
