Even and Odd proof: Direct proof conflict with Counter example

Question: If $n \in \mathbb{Z}$ and $n^5 − n$ is even, then $n$ is even.

My solution: By counter example, let $n = 3$, then $3^5 - 3 = 240 =$ even, but $3 =$ odd.

However, if I use direct proof on this, it will be:

Suppose $n \in \mathbb{Z}$ and $n^5− n$ is even, then $n^5 − n = 2a$, where $a \in \mathbb{Z}$.

It follows that $n(n^4 - 1) = 2a$, which yields $$n = 2\Biggl(\frac{a}{n^4 - 1}\Biggr)$$

Since both $a,n \in \mathbb{Z}$, the term inside the parentheses is also an integer. Hence, $n$ is even because it's a multiple of $2$.

It seems there is something wrong with my logic in the direct proof, because of the counter example...there must be something wrong here. Is it because that I can't have the integer $n$ on the right side to show this proof? But we are given that $n \in \mathbb{Z}$.

I will appreciate it very much if someone can help out.

Thanks

• The parenthetical term could be 1/2 and $n$ would still be an integer, but not even. Commented Dec 1, 2017 at 3:42
• As a side note, $n^5-n$ is always even. This is because $n^2=n\pmod{2}$. Commented Dec 1, 2017 at 3:56
• How do you know that "the term inside the parentheses is also an integer"? Does dividing an integer by an integer always result in an integer? $2$ and $3$ are integers, is $(\frac23)$ an integer?
– bof
Commented Dec 1, 2017 at 4:31

The error occurs between the equation $n(n^4-1)=2a$ and $n= 2\cdot \frac{a}{n^4-1}$. It is not generally true that if an integer $m$ divides $ab$ then it divides either $a$ or it divides $b$. (Consider, e.g. $m=4$, $a=6$, and $b=10$.)
Aside: The implication holds generally if we assume $m$ is prime.
• In fact, that condition is equivalent to $m$ being prime (or zero, or a negative prime). Commented Dec 1, 2017 at 4:30
In fact, your own counterexample shows why the proof can't work (and it shouldn't work, because it's false). In your example, you would have $$3^5-3 = 3(3^4-1) = 2(120)$$ and so $$3 = 2 \left(\frac{120}{3^4-1}\right).$$ But $80$ doesn't divide $120$.