Prove that if n is a positve even integer, then n^2 = 0(mod 8) or n^2= 4(mod 8).

2. Hello, jas05s!

Prove that if $n$ is a positve even integer, then: . $n^2 \equiv 0\text{ (mod 8) }\text{ or }\;n^2 \equiv 4\text{ (mod 8)}$

Since $n$ is an even integer, $n \;=\;4k\text{ or }4k+2$
. . ( $n$ is a multiple of 4, or two more than a multiple of 4.)

If $n = 4k\!:\;\;n^2\:=\:16k^2 \:=\:8(2k^2) \:\equiv\:0\text{ (mod 8)}$

If $n \:=\:4k+2\!:\;\;n^2 \:=\:16k^2 + 16k + 4 \:=\:8(2k^2 + 2k) + 4 \:\equiv \:4\text{ (mod 8)}$