New Year's Countdown Day 14: Yay for 2017!

Find the sum of the last four digits of

201 7 201 7 2017 . \large{ 2017^{2017^{2017}}. }

Basing on the first problem I've ever posted on Brilliant back in 2014.


This problem is part of the set New Year's Countdown 2017 .


The answer is 24.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Chew-Seong Cheong
Dec 14, 2017

Let N = 201 7 201 7 2017 N = 2017^{2017^{2017}} . We need to find N m o d 10000 N \bmod 10000 . Since 2017 is prime, we can use Euler's theorem and the respective Carmichael lambda values are λ ( 10000 ) = 500 \lambda (10000) = 500 and λ ( 500 ) = 100 \lambda (500) = 100 . Then, we have:

N 201 7 201 7 2017 m o d 100 m o d 500 (mod 10000) 201 7 201 7 17 m o d 500 (mod 10000) 201 7 1 7 17 m o d 500 (mod 10000) 201 7 ( 10 + 7 ) 15 ( 1 7 2 ) m o d 500 (mod 10000) 201 7 ( 150 + 7 15 ) ( 289 ) m o d 500 (mod 10000) 201 7 ( 150 + ( 50 1 ) 7 ( 7 ) ) ( 289 ) m o d 500 (mod 10000) 201 7 ( 150 + ( 349 ) ( 7 ) ) ( 289 ) m o d 500 (mod 10000) 201 7 ( 93 ) ( 289 ) m o d 500 (mod 10000) 201 7 377 (mod 10000) ( 2000 + 17 ) 375 ( 2000 + 17 ) 2 (mod 10000) 1 7 375 ( 4000 + 289 ) (mod 10000) ( 20 3 ) 375 ( 4289 ) (mod 10000) ( 7500 3 375 ) ( 4289 ) (mod 10000) By modular inverse (see note) 7500 3307 ( 4289 ) (mod 10000) 3777 (mod 10000) \large \begin{aligned} N & \equiv 2017^{2017^{2017 \bmod 100}\bmod 500} \text{ (mod 10000)} \\ & \equiv 2017^{2017^{17}\bmod 500} \text{ (mod 10000)} \\ & \equiv 2017^{17^{17}\bmod 500} \text{ (mod 10000)} \\ & \equiv 2017^{(10+7)^{15}(17^2) \bmod 500} \text{ (mod 10000)} \\ & \equiv 2017^{(150+7^{15})(289) \bmod 500} \text{ (mod 10000)} \\ & \equiv 2017^{(150+(50-1)^7(7))(289) \bmod 500} \text{ (mod 10000)} \\ & \equiv 2017^{(150+(349)(7))(289) \bmod 500} \text{ (mod 10000)} \\ & \equiv 2017^{(93)(289) \bmod 500} \text{ (mod 10000)} \\ & \equiv 2017^{377} \text{ (mod 10000)} \\ & \equiv (2000+17)^{375}(2000+17)^2 \text{ (mod 10000)} \\ & \equiv 17^{375}(4000+289) \text{ (mod 10000)} \\ & \equiv (20-3)^{375}(4289) \text{ (mod 10000)} \\ & \equiv (7500-{\color{#3D99F6}3^{375}})(4289) \text{ (mod 10000)} & \small \color{#3D99F6} \text{By modular inverse (see note)} \\ & \equiv 7500-{\color{#3D99F6}3307}(4289) \text{ (mod 10000)} \\ & \equiv 3777 \text{ (mod 10000)} \end{aligned}

Therefore, the sum of the last four digits is 3 + 7 + 7 + 7 = 24 3+7+7+7 = \boxed{24} .


Note:

3 380 ( 10 1 ) 190 (mod 10000) 190 × 189 × 1 0 2 2 190 × 10 + 1 (mod 10000) 3601 (mod 10000) 3 5 × 3 375 3601 (mod 10000) 243 × 3 375 3601 (mod 10000) 243 × 7 1701 (mod 10000) 243 × 307 4601 (mod 10000) 243 × 3307 1601 (mod 10000) 3 375 3307 (mod 10000) \begin{aligned} 3^{380} & \equiv (10-1)^{190} \text{ (mod 10000)} \\ & \equiv \frac {190\times 189 \times 10^2}2 - 190\times 10 + 1 \text{ (mod 10000)} \\ & \equiv 3601 \text{ (mod 10000)} \\ \implies 3^5\times 3^{375} & \equiv 3601 \text{ (mod 10000)} \\ 243 \times 3^{375} & \equiv 3601 \text{ (mod 10000)} \\ 243 \times 7 & \equiv 1701 \text{ (mod 10000)} \\ 243 \times 307 & \equiv 4601 \text{ (mod 10000)} \\ 243 \times 3307 & \equiv 1601 \text{ (mod 10000)} \\ \implies 3^{375} & \equiv 3307 \text{ (mod 10000)} \end{aligned}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...