Number theory, random task I have this pretty random task and I really don't where to begin. I hope that somebody would help me. The question is very simple:
Find the smallest positive integer, so when is took to the third exponent, its last    digits will be  ...888
 A: Let's start with a simpler task: finding numbers $n$ such that their cubes end with 8 in decimal. Clearly they need to be even, so let's look at 2, 4, 6, 8, and 10. Their cubes are 8, 64, 216, 512, and 1000 so only 2 worked. These are the only final digits that could work, so the numbers which have cubes ending with 8 are exactly those of the form $10n+2$.
Can you continue this process?
A: Start with a bit less ambition: For which $n$ does $n^3$ end in $\ldots 8$? The last digit depends only on the last digti of $n$ and as you can check, this last digit must be $2$. So $n= 10k+2$ for some integer $k$.
Then $n^3=(10k+2)^3=1000k^3+600k^2+120k+8$ and we note that the tens digit of $n^3$ is the ones digit of $2k$. To make this equal $8$, we must have $2k=10m+8$ or equivalently $k=5m+4$ for some integer $m$, so that $n=10k+2=50m+42$. Expand $n^3=(50m+42)^3$ as above and make a similar conclusion about the last digit of $m$, thus finding an expression for all integers $n$ such that $n^3$ ends in $888$.
