Proof by Cases [discrete mathematics]

65 Views Asked by At

So I've come across this interesting proof question that I'm trying to solve but I'm rather confused about how to go about starting it. Any help would be greatly appreciated:

Prove that if $n$ is a positive integer, then $n^3+4n+2$ is not divisible by 4. Hint: divide the proof into two cases.

Thank you!

2

There are 2 best solutions below

1
On BEST ANSWER

Assume

1) $n$ is odd:

$n=2k+1, k=0,1,2,....$

$(2k+1)^3+4(2k+1)+2=$

$1+3(2k)+3(2k)^2 +(2k)^3+$

$8k+6=$

$[3(2k)^2+ (2k)^3]+7(2k+1)$;

The first term (in brackets) is divisible by $4$,

$7(2k+1)$ is not (why?).

Hence $f(n)$ is not divisible by $4$ for odd $n$.

2) Let $n$ be even, $n=2k$, k=1,2,... and complete the proof.

0
On

$$n^3+4n+2\equiv n^3+2\mod4$$When $n$ is odd, $n^3$ is odd and so is $n^3+2$. When $n$ is even, $2|n\implies 4|n^3\implies n^3+2\equiv2\mod4$.