How can one prove a recognized modulo pattern? Suppose you need to know what the possible unit digits are for integers written on the form $4n^2$ for some integer $n$. Me myself have always just relayed on numerical investigation, i.e. compute the answer for the first few values of $n$ and assume that the observed pattern (if found) goes on for ever. For example.
The first few values of $4n^2$:
$[4, 16, 36, 64, 100, 144, 196, 256, 324, 400]$
Computing modulo $10$ of above numbers yields:
$[4, 6, 6, 4, 0, 4, 6, 6, 4, 0]$
And so I would just assume that the unit digit follow the pattern $(4, 6, 6, 4, 0,...)$ and deduce that the only possible unit digit values are $0,4,6$. But so far this is just an observation and one must prove that this pattern goes on forever if one is to be certain that the only unit digits possible are indeed $0,4,6$. How can you prove this or rather, what is the general approach for proving that patterns recognized modulo $m$ repeats to infinity? That is, don't get stuck on the fact that we are  talking unit digits above. Another example would be $n^2 (mod 8)$ which gives the recognizeable pattern to prove:
$[1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4]$
So to clarify, what I'm asking is: Do there exist a general approach or some tricks that are commonly used to prove that such modulo patterns continue forever? Or is it very "case specific" depending on the expression that you are working with, whereas sometimes you have to factor and other times use famous theorems etc.? Thanks.
 A: Let's assume that you have found the length of the recurring pattern to be $r$. Then you want to show that $$f(n+r) \equiv f(n) \pmod {m}$$
For example, in the case of $f(n) = 4n^2, m = 10, r = 5$, you want to show that $$4(n+5)^2 \equiv 4n^2 \pmod {10}$$ This can easily be seen by expanding the square to get $$4n^2+40n+100 \equiv 4n^2 \pmod {10}$$
A: Just as you and some of the commenters have mentioned, the easiest way to deduce a pattern is to use the general formula $x \equiv y (\mod m)$. Once you've chosen an integer $m$ and written this modulo equation for the first term of your sequence, you calculate the units digit for subsequent terms using this equation. 
Let's say you choose $m = 10$. Then for $n = 1$, $4n^2 = 4$, and $4 \equiv 4 (\mod 10)$. Then for $n = 2$, the equation gets multiplied by $4$, the right hand side becomes $16 (\mod 10) \equiv 6 (\mod 10)$. For $n = 3$, you'd get $36 (\mod 10) \equiv 6 (\mod 10)$. For $n = 4$, you'd get $64 (\mod 10) \equiv 4 (\mod 10)$. For $n = 5$, you'd get $100 (\mod 10) \equiv 0 (\mod 10)$. For $n = 6$, you'd get $4 \times 36 (\mod 10) \equiv 4 (\mod 10)$, at which point the whole pattern starts anew.
From this, you can infer that the pattern repeats every 5 integers. Then, notice that $4(n + 5)^2 = 4(n^2 + 25n + 25) = 4n^2 + 100n + 100$. Since by definition, $100n \equiv 0 (\mod 10)$ for all integers $n$, we see that $4(n + 5)^2 \equiv 4n^2 (\mod 10)$.
