[Math] prove that an integer a is odd if and only if it can be written as a sum of two consecutive integers

elementary-number-theoryproof-verification

Can someone please revise my proof.

(->)

Let $a$ and $x$ be arbitrary integers.
Assume $a$ is odd so there exists an integer $k$ s.t $a = 2k + 1$.
$a = 2k + 1 = k + k + 1= k + (k+1)$ , evidently $a$ is the sum of two consecutive integers.

(<-)

Let $a$ be the sum of two consecutive integers.
$a = x + (x+ 1) = 2x + 1$. by def. of odd, $a$ must be odd.

Best Answer

It's logically fine, but stylistically, it doesn't look nice to define the term $x$ in your first direction, and then not use it until your second direction, and then use two different uses of $a$ among both directions.

If you want to redefine the terms within each direction, that's fine, they are separate proofs. If you want to define the terms once and refer to them within each direction, that's OK too, but don't do a mixture of both.

Furthermore, x is not really arbitrary, in that it is dependent on $a$. I would write "suppose that $a$ is the sum of two consecutive integers. Then there exists an integer $x$ such that $a = x + (x + 1)$