Which positive integers can be written in the following form?

217 Views Asked by At

I was investigating a generalisation of this problem and found that it reduced to finding where the expression $$\frac{p(p+2m+1)}{2}$$ is an integer, where $p\ge 2$ and $m \ge 0$.
Since exactly one of the factors is odd, the only case I can certainly exclude would be the powers of two, but I have been unable to show that every other number can be expressed in this way. For example, letting $p=2$ we get the odd numbers $\ge 3$.

1

There are 1 best solutions below

1
On BEST ANSWER

Let $n$ be your target number.

If $n$ has an odd factor $x$ with $2 \le x$ and $n\ge \frac{x(x+1)}2$, let $p=x$ and let $m=\dfrac np - \dfrac{p+1}2$ which is a weakly positive integer.

If $n$ has an odd factor $x$ with $n$ smaller than $\frac{x(x+1)}2$, let $p+2m+1=x$ which gives $p=2\dfrac nx$ and $m=\dfrac{x-p-1}2 = \dfrac{x-1 - 2\dfrac nx}2 > \dfrac{x-1 - (x+1)}2 =-1$ which is a weakly positive integer.

So, the only remaining cases are numbers that only have the odd factor $1$, that is powers of two.