Show that the square of any positive integer cannot be of the form 5q+2 or 5q+3 for any integer q.
Let a be any positive integer
By Euclid's division lemma
$$a=bm+r$$
$$a=5m+r$$ (when $$b=5$$)
So, r can be $$0,1,2,3,4$$
Case 1:
$$\therefore a=5m$$ (when $$r=0$$)
$$a^2=25m^2$$
$$a^2=5(5m^2)=5q$$
where $$q=5m^2$$
Case 2:
when $$r=1$$ (when $$r=1$$)
$$a=5m+1$$
$$a^2=(5m+1)^2=25m^2+100m+1$$
$$a^2=5(5m^2+2m)+1$$
$$=5q+1$$ where $$q=5m^2+2m$$
SimilarlyCase 3:
$$a=5m+2$$
$$a^2=25m^2+20m+4$$
$$a^2=5(5m^2+4m)+4$$
=$$5q+4$$
where $$q=5m^2+4m$$
Case 4:
$$a=5m+3$$
$$a^2=25m^2+30m+9$$
$$=25m^2+30m+5+4$$
$$=5(5m^2+6m+1)+4$$
$$=5q+4$$
where $$q=5m^2+6m+1$$
Case 5:
$$a=5m+4$$
$$a^2=25m^2+40m+16=25m^2+40m+15+1$$
$$=5(5m^2+8m+3)+1$$
$$=5q+1$$ where $$q=5m^2+8m+3$$
So none are in the form 5q+2 or 5q+3.