# Need examples of $n^{20}$ & $n^{200}$ to see a pattern.

Let n be an even integer not divisible by 10. What digit will be in the tens place in $$n^{20}$$, and in the hundreds place in $$n^{200}$$? Can you generalise this?

The problem I have is that I can't seem to find examples to see some pattern. A Casio scientific calculator can only go up to $$4^{20}$$, and Google isn't giving me much either. So I don't know what I'm supposed to see, let alone how to generalise this.

Edit 1: Turns out I didn't understand the question. I'm supposed to look at the tens (ie. 2nd) digit of $$n^{20}$$ and the hundreds (ie. 3rd) digit of $$n^{200}$$. As I'm recording examples from $$n=2, 4, 6, 8, 12, 14, 16, 18,...$$, I still don't see a pattern. Is there supposed to be a pattern, and I'm just doing it wrong, or nuh?

Edit 2: I didn't see a pattern because I was looking at the front digits rather than the back digits (Hi GCSE maths! It's been a minute!). But this brings me back to the very first question I asked. While $$2^{20} = 1048576$$, $$2^{200} = 1.606938e+60$$. How do I find the hundreds digit from that?

• When you say "tenth place", do you mean from the right or from the left? – Arthur Jan 27 at 14:32
• From the right. – Black Dragon Jan 27 at 14:36
• From the right the first place is the units, the second is the tens, the third is the hundreds etc., so you want the billions? Work modulo $10$ billion then (or if you meant the tens place, modulo $100$). Every time you multiply by $n$, trim to a remainder. Even better, use $n^4=(n^2)^2,\,n^5=n^4n,\,n^{20}=(n^5)^4,\,n^{200}=(((n^5)^5)^4)^2$ for fewer multiplications. – J.G. Jan 27 at 14:39
• And do you mean "tenth place" or "ten's place"? – Arthur Jan 27 at 14:42
• Wait... There's a difference between tenth place and tens place? – Black Dragon Jan 27 at 14:45

I expect what they're hoping for you to discover is that, for $$n\neq 0\pmod{5}$$, $$n=0\pmod{2}$$, \begin{align} n^{20} &= ? \pmod{100} \\ n^{200} &= ? \pmod{1000} \\ n^{2000} &= 9376 \pmod{10000} \\ n^{20000} &= 09376 \pmod{100000} \\ n^{200000} &= 109376 \pmod{1000000} \\ n^{2000000} &= 7109376 \pmod{10000000}\text{.} \end{align} These results follow from the binomial theorem, Euler's generalization of Fermat's little theorem, and the Chinese remainder theorem.

• Since I still don't see any pattern from this, could you explain how you came to that expectation? – Black Dragon Jan 28 at 5:26
• The important first step is to use the binomial theorem to show that $n^{20}\pmod{100}$, $n^{200}\pmod{1000}$, etc., depend only on the ones digit of $n$, so you really only need to calculate these classes for $n=2,4,6,8$. As noted in the comments, it shouldn't be too hard to find these classes using modular exponentiation by squaring in a spreadsheet program, say. (If you run into arithmetic overflow problems or overly large numbers, you're doing it wrong.) – K B Dave Jan 28 at 7:32

Take for example the number $$2$$ so you will get $$2^{20}=1048576$$ and $$2^{100}=1267650600228229401496703205376$$

• I've edited my question because I didn't understand it at first. While looking at examples, I've yet to see some pattern. Am I doing it wrong? – Black Dragon Jan 27 at 22:29

I think what this question is really about is proving $$100|n^{200}-n^{20}$$. It will help to first prove $$100|n^{20}-k$$ for some $$k\in\{0,\,1,\,25,\,76\}$$, and that $$100|k^{10}-k$$ for each such $$k$$. You can do the first part by considering $$n^{20}$$ modulo $$4,\,25$$ with the Fermat-Euler theorem; note that $$\varphi(4)=2,\,\varphi(25)=20$$ both divide $$20$$.