1

What are the last 2 digits of $2017^{2017}$?

Notice that $$2017 (2017) = 2017 ( 2000 + 10 + 7) = (....000) + (....70) + (2017 \times 7)$$ so the last two digits of $2017^{2}$ are the last two digits of $70$ + last two digits of $17 \times 7$. These are $89$.

Similarly then

$$ (2017^2) (2017) = (....89)(2000 + 10 + 7) = (....000) + (....90) + (....89)\times7 $$

So the last two digits of $2017^{3}$ are the last two digits of $90$ + last two digits of $89 \times 7$. These are $13$.

for $2017^{4}$, the last two digits are the last two of $30$ + last two of $13 \times 7$.


But somehow, I have not find the period for the last two digits of $2017^{n}$. I have tried until $n=36$, still no period.

The answer should be one of $77,81,93,37,57$.


I just found a pattern: $$ n=1,n=2,n=3,n=4 \rightarrow 17, 89, 13,21 $$ this pattern repeats as: the 1st one with difference 40, 2nd with diff 80, 3rd with diff 60, and 4th with diff 20. $$ n=5,n=6,n=7,n=8 \rightarrow 57, 69, 73,41 $$ and so on. The overall period begin again from $n=17$.

So the last digit is 77. The math explanation?

Redsbefall
  • 4,845
  • There are several threads of the type find the last $n$ digits of this huge power linked to that mother duplicate target. Please search before posting. – Jyrki Lahtonen Jun 23 '19 at 08:24
  • The Carmichael function of $100$ is $\lambda(100)=20$, so you should have seen a period starting to repeat before $n=36$. – Jyrki Lahtonen Jun 23 '19 at 08:26
  • Hint: $2017\equiv17\pmod{100}$; also $\varphi(100)=40$ and $2017\equiv17\pmod{40}$. – egreg Jun 23 '19 at 08:26
  • $2017^{2017}\equiv 1{\pmod{4}}$ and $2017^{2017}\equiv (-8)^{-3}\equiv -(2^9)^{-1}\equiv -12^{-1}\equiv 2\pmod{25}$, so you may simply use the CRT. – Jack D'Aurizio Jun 23 '19 at 19:51
  • I reopened your question and added an answer addressing the question in your edit (which is not addressed in the generic proposed dupe). If anything is still unclear then please feel welcome to ask questions and I will be happy to elaborate. – Bill Dubuque Jun 24 '19 at 13:43
  • I also added a Remark giving links to more general methods - which are well-worht learning if you do much number theory of this sort. – Bill Dubuque Jun 24 '19 at 15:30

4 Answers4

1

As we're interested in the last two digits, it suffices to compute this modulo $100$. Hence $$ 2017 ^{2017} \equiv 17^{17} \equiv 77 \pmod{100}. $$ The first equivalence holds by Euler's theorem (see the mothertopic mentioned by J. Lahtonen).

AlvinL
  • 8,664
  • But how to easily compute $,17^{\large 17}!\pmod{!100}?,$ Repeated squaring isn't too bad, but often it will be easier to use the OP's observation and the Binomial Theorem for such problems - see my answer. – Bill Dubuque Jun 24 '19 at 01:20
1

Easy Way $\!\bmod 100\!:\ 17^{2016}\!\equiv (17^{\large 2})^{\large 1008}\!\equiv (-1\!+\!90)^{\large 1008}\overset{\rm\color{#c00}{BT}}\equiv 1\!-\!\!\!\!\overbrace{1008(90)}^{\large \equiv\ 8(90)\ \equiv\ 20}\!\!\!\equiv 1\!-\!20\equiv 81$

Generally using $\rm\color{#c00}{BT}=$ Binomial Theorem to lift $\,17^{\large 4}\equiv 1\pmod{\!10}\,$ up to modulo $10^{\large 2}$ is a special case of more general methods, e.g. LTE = Lifting The Exponent here, or see this result

$$a\equiv b\!\!\! \pmod{\!kn}\,\Rightarrow\,a^{\large k}\equiv b^{\large k}\!\!\!\! \pmod{\!k^2n}\qquad$$


OP way $ $ Nice observation, i.e. $\!\bmod 100\,$ the powers of $\,17\,$ have the periodic structure below, where the tens digit in each column increases by a fixed amount in successive rows, viz. by twice the units digit $\!\bmod 10,\,$ e.g the tens digit in column $2$ increases by $\,\color{darkorange}{2\cdot 7}\equiv_{10}\color{darkorange}4,\,$ i.e. $\,\color{#0af}{1,5,9,3,7}$

$$\begin{array}{r|r r} n & 17^{\large n}\!\! & \\ \hline 0 &\ \ 01 & \color{#0af}17 & 89 & 13\\ 4 & 21 & \color{#0af}57 & 69 & 73\\ 8 & 41 & \color{#0af}97 & 49 & 33\\ 12 & 61 & \color{#0af}37 & 29 & 93\\ 16 & 81 & \color{#0af}77 & 09 & 53\\ \end{array}\qquad$$

This structure is due to $\,17^{\large 4}\equiv 21\pmod{\!100}\,$ so multiplying by it has the following effect

$$\bmod 100\!:\ \ 21(10\:\!\color{#0af}t+\color{#c00}u) = 210t+21u\equiv 10(\color{#0af}t+\color{darkorange}{2u}) + \color{#c00}u\ $$

so it has the same units digit $\,\color{#c00}u\,$ and the tens digit $\,\color{#0af}t\,$ is incremented by $\,\color{darkorange}{2u}\bmod 10$.

We don't need the whole table: $\,17^{\large 4}\equiv 21\pmod{\!100},\,$ & $\rm\color{#0a0}{BT}$ = Binomial Theorem imply

$$\bmod 100\!:\,\ 17^{\large 2016}\equiv (17^{\large 4})^{\large 504}\equiv (1\!+\!20)^{\large 504}\overset{\rm\large\color{#0a0}{BT}}\equiv 1+ 504(20)\equiv 1+ 4(20)\equiv 81\qquad$$

by $\,20^{\large k}\equiv 0\,$ for $\,k\ge 2.\,$ Hence we conclude $\, 17^{\large 2017}\equiv 17(81)\equiv 17(-19)\equiv -23\equiv 77$.

Bill Dubuque
  • 272,048
1

It suffices to evaluate $ (2017)^{2017} \pmod {100}: $

$$ \equiv (17)^{2017} \equiv (17^{2})(17) \equiv (-11)^{1008}(17) $$

$$ \equiv (21)^{504}(17) \equiv (21^{5})^{100}(21^{4})(17) \equiv (1)^{100}(21^{4})(17)$$

$$ 77 \pmod {100}$$

Therefore, the last two digits are $77$.

DDS
  • 3,199
  • 1
  • 8
  • 31
0

This old post popped up and I noticed that it was tagged "Contest math" which suggests there ought to be a readily accessible solution. After a moment's thought, I found it could be solved in one's head, or certainly with minimal reliance on pencil and paper.

Almost all previous answers and comments suggest that you start by recognizing that evaluating $2017^{2017} \bmod 100$ reduces to finding $17^{17} \bmod 100$; I begin with that also. Then, I recognized $17$ as being $1$ greater than a power of $2$. This suggests that one can proceed by squaring. I was surprised that none of the previous answers employed this relatively easy method, so I show it here. $$17^2\equiv 89 \bmod 100 \\17^4 \equiv 89^2\equiv (-11)^2 \equiv 21 \bmod 100 \\17^8\equiv 21^2\equiv 41 \bmod 100 \\17^{16}\equiv 41^2 \equiv 81 \bmod 100$$ All that is left is to compute $17^{17}\equiv 17\cdot 81 \bmod 100$, which is the answer arrived at by all others, $77$.