How does this proof that the square of an integer, not divisible by 5, leaves a remainder of 1 or 4 when divided by 5 work?

1.7k Views Asked by At

Below I have a part of a proof of the fact that the square of an integer, not divisible by $5$, leaves a remainder of $1$ or $4$ when divided by $5$. But I am wondering where does the part highlighted in blue come from?

Image showing if n=5k+1 then n^2 = 25 k^2 + 10k + 1 with the 10k highlighted, and so on

2

There are 2 best solutions below

1
On BEST ANSWER

Hint: $(a+b)^2=a^2+2ab+b^2$

1) $(5k+1)^2=(5k)^2+2*5k+1^2=25k^2+10k+1$

4
On

Super-Big Hint: $$\begin{align}(5k+a)^2&=(5k+a)(5k+a)\\&=5k\cdot(5k+a)+a\cdot(5k+a)\\&=(5k)^2+5k\cdot a+a\cdot 5k+a\cdot a\\&=(5k)^2+2a\cdot 5k+a^2\end{align}$$