Show that $8 \mid (a^2-b^2)$ for $a$ and $b$ both odd

If $a,b \in \mathbb{Z}$ and odd, show $8 \mid (a^2-b^2)$.

Let $a=2k+1$ and $b=2j+1$. I tried to get $8\mid (a^2-b^2)$ in to some equivalent form involving congruences and I started with $$a^2\equiv b^2 \mod{8} \Rightarrow 4k^2+4k \equiv 4j^2+4j \mod{8}$$ $$\Rightarrow k^2+k-j^2-j=2m$$ for some $m \in \mathbb{Z}$ but I am not sure this is heading anywhere that I can tell.

Second attempt: Use Euler's Theorem and as $\gcd(a,8)=\gcd(b,8)=1$ and $\phi(8)=4$, $a^4 \equiv b^4 \equiv 1 \mod 8$ so $a^4-b^4\equiv 0 \mod{8}$.

I haven't gotten too much further are there any hints?


Solution 1:

HINT:

$k^2-j^2+k-j=(k-j)(k+j+1)$

As $(k+j+1)-(k-j)=2j+1$ which is odd, they must be of opposite parity, exactly one of them must be divisible by $2$

Method 2:

If $a,b$ are odd, observe that one of $(a-b),(a+b)$ is divisible by $4,$ the other by $2$

Method 3:

$(2a+1)^2=4a^2+4a+1=8\frac{a(a+1)}2+1\equiv 1\pmod 8$

Solution 2:

Hint:

$$a^2 \equiv b^2 \equiv 1 \pmod8$$

When both $a$ and $b$ are odd.

$(2k+1)^2=4k^2+1+4k=4k(k+1)+1$, here either $k$ or $k+1$ is even.

Therefore $4k(k+1) \equiv 0 \pmod 8$

Solution 3:

The given condition says that $a,b$ both are odd. So let, $a=2k+1$ and $b=2l+1$ where $k,l$ are some integers.

Now, $a^2-b^2=4k^2+4k+1-(4l^2+4l^2+1)=4(k^2-l^2+k-l)$

$$=4((k^2-k)(l^2-l))=4(k(k-1)+l(l-1)$$.

Notice that $k(k-1),l(l-1)$ are products of two consecutive integers and hence divisible by $2$. So, you can write them as $k(k-1)=2m, l(l-1)=2p$.

Therefore: $a^2-b^2=4(k(k-1)+l(l-1))=4(2m+2p)=8(m+p)$