Pattern on last digits of numbers to a certain power There are 4 one-digit numbers which when squared have a last digit equal to the first number. They are 0,1,5 and 6.
There are 2 two-digit numbers which when squared have their last two digits equal to the first number. They are 25 and 76.
There are 2 three-digit numbers which when squared have their last three digits equal to the first number. They are 625 and 376. (i.e. 376^2 = 141376, ends with 376, 625^2 = 390625, ends with 625)
This pattern can be continued for n-digit numbers which when squared have their last n-digits equal to the former number. 
This pattern can continue indefinitely. [The proof is left to the reader]
i.e. Prove $5, 25, 625, 0625, 90625, 890625,...$ (we will count 0625 as part of the pattern even though it is not a four digit number as only 0 works and also because it continues the pattern.) and $6, 76, 376, 9376, 09376, 109376, 7109376, 87103976,...$ will continue indefinitely.
However, that cannot just be my question since it's been asked before. (automorphic numbers)
Therefore, what about other powers? ($n^3, n^4$)
[Edit: I forgot to mention and so on. So I actually wanted a general case $n^i$]
Or even to the power of itself? ($n^n$)
 A: Those numbers are called Automorphic numbers (as you just said). There is a longer list here: 
https://oeis.org/A007185 is $5^{2^n}$ $\mod 10^n$
https://oeis.org/A016090 is $16^{5^n}$ $\mod 10^n$
There are also other sequences like these for any $a$, coprime to $10$, the Automarphic sequence is $a^{10^n}$ $=$ 1 $\mod 10^n$, and if $a$ $=$ $10x$, then $a^n$ $=$ 0 $\mod 10^n$.
$n^3$, any string of digits ending in 1, 3, 7, 9 can be the ending digits of a perfect cube, for other strings, the last three digits are a multiple of 8, 125 or just 000 (for numbers $n$ divisible by 10)
If $x$ is coprime to 10, then there is an integer $a$ such that:
$a^a$ $=$ $x$ $\mod 10^n$, so it is easy to see that the last digit of $a^a$ is either 0, 1, 3, 4, 5, 6, 7, 9.  
A: I'm not sure how you'd do this for $n^n$, but other powers can be done using modular arithmetic.  For example, if you want to know what numbers, when cubed, have the last $2$ digits of the original number, you are solving
$$n^3\equiv n\pmod{100}$$
$$n^3-n=n(n+1)(n-1)\equiv0\pmod{100}$$
In other words, $n(n-1)(n+1)$ is a multiple of $100$.  First, take a look at when it's a multiple of $4$.  Solutions for this are $n\equiv0,1$ or $3\pmod4$.  Now to see when it's a multiple of $25$.  If any of the $3$ factors are multiples of $5$, the remaining $2$ factors cannot. So we have $n\equiv-1,0,$ or $1\pmod{25}$.  So if $n$ ends in $00,01,24,25,49,51,75,76,$ or $99$, $n^3$ should as well.
Higher powers get more complicated.  As for the fourth power, the equation becomes
$$(n^2-n)(n^2+n+1)\equiv0\pmod{10^a}$$
That second term does not seem to be a multiple of $2$ or $5$ for any value of $n$.  Therefore, the only numbers where $n$ and $n^4$ share trailing digits are those where $n$ and $n^2$ share trailing digits.
