A trick for calculating $n^6$ that I don't understand I was doing a math exercise and it asked to find what are the possible units digits of $n^6$ knowing that $n\in\mathbb Z$. The solution said that because we are concerned only with finding what the units digits of $n^6$ could be, it is sufficient to take the sixth power of numbers $0,1,2,\dots,9$ and the results would be our answers (which are $0,1,4,5,6,9$). How come this is true? Thanks for your help!
 A: What is the units digit of $340274513\times 384759374\,{}$?
$$
\begin{array}{ccccccccccccc}
& & & & 3 & 4 & 0 & 2 & 7 & 4 & 5 & 1 & 3 \\
& & & \times & 3 & 8 & 4 & 7 & 5 & 9 & 3 & 7 & 4 \\
\hline
& & & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & 2 \\
& & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
& \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
\cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
& & & \vdots \\
& & & \vdots \\
\hline
\cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & 2   
\end{array}
$$
The method of multiplying that you learned as a child shows you that the units digit in the product is determined by the units digits, and not any of the other digits, in the numbers that you're multiplying.
Moreover you can write the number $340274513$ as $\Big(34027451\times10\Big)+3$ and $384759374$ as $\Big(38475937\times 10\Big)+4$, and then you have
\begin{align}
& 340274513\times384759374 \\[10pt]
= {} &  \Big(\big(34027451\times10\big)+3\Big)\times\Big(\big(384759374\times10\big)+4\Big) \\[10pt]
= {} & \Big(\underbrace{\text{something}\times 10}_{\begin{smallmatrix} \text{This contributes} \\  \text{nothing to the} \\  \text{units digit.} \end{smallmatrix}}\Big) + (3\times 4)
\end{align}
A: Suppose that $a,b\in\mathbb{Z}$. By the binomial theorem $$(10a+b)^k=10^ka^k+\binom{k}{1}10^{k-1}a^{k-1}b+\cdots+\binom{k}{1}10ab^{k-1}+b^k$$ $$=10c+b^k$$ for some $c\in \mathbb{Z}$, so the units digit of $(10a+b)^k$ and $b^k$ are the same.
More generally, this follows since multiplication modulo $10$ (or any modulus) is well defined.
A: Note that $(10a+b)(10c+d) = 10(10ac+ad+bc)+bd$
This is just an algebraic way of looking at the long multiplication shown by Michael Hardy. Whenever we multiply two positive integers, the units digit depends only on the units digits of the original numbers.
This then obviously applies to three or more factors, and applies whether factors are the same or different.

The same logic applies to remainders on dividing by some number other than $10$ 
A: A bit more advanced but more general: For all $a,b\in\mathbb{Z}$,
$n\in\mathbb{N}$
$$
(a\cdot b)\bmod n=(a\bmod n)\cdot (b\bmod n)
$$
Now apply this inductively with $n=10$ and note that the last digit
of a number is its residue mod $n$
A: If you do the calculations using pencil and paper then the units digit of $n^6$ depends solely on the units digit of $n$, whatever $n\in{\mathbb N}$.
