Let a=n2−1.
We know, any odd integer n can be represented by
n = 2q + 1, where q is an integer.
square of n, n2=(2q+1)2=4q2+4q+1=4(q2+q)+1
So, a=n2−1 = 4(q2+q)+1−1 = 4(q)(q+1)
case 1 : q is odd
⇒ (q+1) is even. Then we can write
q + 1 = 2k , for some integer k
then,
a=4q(q+1)=4q(2k)=8qk
⇒ 8 divides a = n2−1
case 2 : q is even
⇒ q = 2k , for some integer k.
then, a=4q(q+1)=4(2k)(q+1)=8k(q+1)
⇒ 8 divides a = n2−1
Therefore for any odd integer n, n2−1 is divisible by 8.