I was programming and I realized that the last digit of all the integer numbers squared end in $ 0, 1, 4, 5, 6,$ or $ 9 $.
And in addition, the numbers that end in $ 1, 4, 9, 6 $ are repeated twice as many times as the numbers that end in $ 0, 5$
I checked the numbers from $1$ to $1000$, and the results are:
$1.$ The numbers on the left are the last digit of each digit squared.
$2.$ The numbers on the right are the number of times that the last digit is repeated.
$$ \begin{array}{cc} 0: &100, \\ 1: &200, \\ 4: &200, \\ 5: &100, \\ 6: &200, \\ 9: &200 \end{array} $$
So, why does this happen? What is the property that all integers have?
These numbers are the squares modulo 10. Notice that the square of the number $10n+k$ is $$ (10n+k)^2 = 10(10n^2+2nk)+k^2, $$ so the last digit of the square is determined by only the last digit of the original number. In particular, we find $$ 0^2=0 \quad 1^2=1 \quad 2^2 = 4 \quad 3^2 = 9 \quad 4^2 = 10+6 \\ 5^2 = 20+5 \quad 6^2 = 30+6 \quad 7^2 = 40+9 \quad 8^2 = 60+4 \quad 9^2 = 80+1, $$ or writing "$\equiv$" to mean that they have the same last digit, $$ 0^2 \equiv 0 \\ 1^2 \equiv 1 \equiv 9^2 \\ 2^2 \equiv 4 \equiv 8^2 \\ 3^2 \equiv 9 \equiv 7^2 \\ 4^2 \equiv 6 \equiv 6^2 \\ 5^2 \equiv 5, $$ so every last digit except $0$ and $5$ is the last digit of two squares out of a block of 10 consecutive numbers, while $0$ and $5$ are the last digit of only one each.