Question 755184
If n is any integer not divisible by 5, when we divide it by 5 we get 1, 2, 3, or 4 as a remainder. That means that
{{{n=5p+1}}} (remainder=1), or
{{{n=5p+2}}} (remainder=2), or
{{{n=5p+3}}} (remainder=3), or
{{{n=5p+4}}} (remainder=4),
for some integer p.
 
If {{{n=5p+1}}}, then
{{{n^2=(5p+1)^2=25p^2+10p+1=5(5p^2+2p)+1}}},
which is {{{n^2=5k+1}}} with {{{k=5p^2+2p}}}
If {{{n=5p+2}}}, then
{{{n^2=(5p+2)^2=25p^2+20p+4=5(5p^2+4p)+4}}},
which is {{{n^2=5k+4}}} with {{{k=5p^2+4p}}}
If {{{n=5p+3}}}, then
{{{n^2=(5p+3)^2=25p^2+30p+9=25p^2+30p+5+4=5(5p^2+6p+1)+4}}},
which is {{{n^2=5k+4}}} with {{{k=5p^2+6p+1}}}
If {{{n=5p+4}}}, then
{{{n^2=(5p+4)^2=25p^2+40p+16=25p^2+40p+15+1=5(5p^2+8p+3)+1}}},
which is {{{n^2=5k+1}}} with {{{k=5p^2+8p+3}}}