Let
a be any positive integer and
b=3Then, by Euclid's division lemma,
a=3q+r
Since 0≤r<3, the possible remainders are 0,1 and 2.
i.e., a can be of the form 3q,3q+1 or 3q+2
Now, if a=3q⟹a2=9q2=3×3q2
a=3q+1⟹a2=9q2+6q+1=3(3q2+2q)+1
a=3q+2⟹a2=9q2+12q+4=3(3q2+4q+1)+1
[where, 3q2,3q2+2q and 3q2+4q+1 can be expressed by integer ′p′ for some values of p]
This implies that a2 is of the form 3p or 3p+1, where p is the integer
Hence, square of any positive integer is of the form 3p or 3p+1