Find the last 4 digits of
2 0 1 7 2 0 1 7 2 0 1 7
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.
Phenomenal solution :) You're one of my new favorite solution writers!
2017^2017 mod 10000 = 8177
But we need 2017^(2017^2017) mod 10000
Which is the same as...{by using euler's totient} 2017^8177 mod 10000
Which is.... 3777....
How did you get 8177 and 3777, respectively?
Log in to reply
By solving dude. I didn't mention
Log in to reply
How did you solve it? Where did these numbers come from?
Log in to reply
@Pi Han Goh – 2017^2017 is congruent to 8177 mod 10000. And 2017^8177 is congruent to 3777 mod 10000.
Log in to reply
@Aditya Moger – How did you compute these 2 numbers: 8177 and 3777?
Log in to reply
@Pi Han Goh – @Pi Han Goh - By using euler's totient
Log in to reply
@Aditya Moger – That's not written in your solution. People who can't solve this question can't find your solution to be helpful.
First of all, as Pi said, you didn't explain where you get those numbers, secondly congruences don't work like that, you can't say
a b ≡ a b m o d c m o d c
You can instead use Euler's Theorem
a b ≡ a b m o d ϕ ( c ) m o d c
If and only if g cd ( a , c ) = 1
Log in to reply
Then argue with David M Burton
Log in to reply
Who is David M Burton? Why do you need someone else to argue for you?
Log in to reply
@Pi Han Goh – You don't know who is David M Burton. He is a great mathematician and is the author of the book elementary number theory.
Log in to reply
@Aditya Moger – How is he relevant to this discussion?
Problem Loading...
Note Loading...
Set Loading...
The question translates to
x ≡ 2 0 1 7 2 0 1 7 2 0 1 7 m o d 1 0 0 0 0 0 ≤ x ≤ 9 9 9 9
And in case add some 0 s if x is not a 4 -digit number
We will split in modulo 1 6 and modulo 6 2 5
x ≡ 2 0 1 7 2 0 1 7 2 0 1 7 ≡ ( 1 2 6 ⋅ 1 6 + 1 ) 2 0 1 7 2 0 1 7 ≡ 1 2 0 1 7 2 0 1 7 ≡ 1 m o d 1 6
Now modulo 6 2 5 :
x ≡ 2 0 1 7 2 0 1 7 2 0 1 7 ≡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