T m = m times 1 7 1 7 ⋅ ⋅ ⋅ 1 7
Find the smallest possible value of n such that the numbers T n , T n + 1 , T n + 2 , … all have the same last (rightmost) 2017 digits.
Bonus: Generalize to the last k digits.
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.
Wow, I surely wouldn't ever come up with such a solution. May I ask you where you learned this advanced (to me) modular arithmetic or am I still too young for it?
Log in to reply
Well I learned this at university. Primitive roots modulo prime powers are a topic often left out of elementary textbooks on number theory (or come right at the end), but there is plenty out there on the Internet to be found. There is quite a discussion on the Internet, on MSE at the like, about power towers (which this question is all about).
Awesome and complete formal solution.
You can actually guess solution with Excel! Not a proof but a quick guess within 5min!
First for k = 2: Create and index column from 1 to 100 (10^k), another column to find mod(17^k,100) (You can avoid large number by referring the previous mod). Notice that at 17^100 mod 100 = 1. So look for the last 2 digit for 1 7 1 7 , it's 77. Therefore 1 7 1 7 1 7 m o d 1 0 0 = 1 7 7 7 m o d 1 0 0 , which is 77! So at n=2, the circles begins!
Repeat for k =3: Same discovery: When we exponentiate 17 with a power with the last digits "777", we will get a number with the last digits "777" => n=3
See the pattern?
Note: This solution is incorrect. Can you spot the error?
Generalization
I'll define ϕ m ( t ) as follows for later use
ϕ m ( t ) = m c t i m e s ϕ ( ϕ ( … ϕ ( t ) … ) )
Where ϕ is Euler's Totient Function
First Case: k = 1
The smallest n is 1 because, since ϕ ( 1 0 ) = 4
T a = a 1 7 1 7 . . . 1 7 ≡ a 7 1 . . . 1 7 ≡ 7 m o d 1 0
Second Case: k = 2
The smallest n is 2 , in a similar way, since ϕ 2 ( 1 0 0 ) = 1 6
T a = a 1 7 1 7 1 7 . . . 1 7 ≡ a 1 7 1 7 1 . . . 1 7 ≡ 1 7 1 7 m o d 1 0 0
General Case: k ≥ 3
We will evaluate the remainders m o d 2 k and m o d 5 k and then combine using the CRT . We have to find the smallest m 1 , m 2 such that 1 7 ≡ 1 m o d ϕ m 1 ( 2 k ) and 1 7 ≡ 1 m o d ϕ m 2 ( 5 k ) and then consider the biggest of the two. This is because this generates a 1 in the tower, so that even if we add more 1 7 to it, the remainder won't change
If k = 3 or k = 4 , T a always leaves a remainder of 1 m o d 2 k .
If k > 4 , we have that ϕ k − 4 ( 2 k ) = ( 2 1 ) k − 4 ⋅ 2 k = 2 4 = 1 6
and 1 7 ≡ 1 m o d 1 6 , so the minimal n is at least k − 4 , let's check what happens m o d 5 k
ϕ k ( 5 k ) = 5 4 ( 5 2 ) k − 1 ⋅ 5 k = 2 k + 1
ϕ 2 k − 3 ( 5 k ) = ϕ k − 3 ( ϕ k ( 5 k ) ) = ϕ k − 3 ( 2 k + 1 ) = ( 2 1 ) k − 3 ⋅ 2 k + 1 = 2 4 = 1 6
And again, 1 7 ≡ 1 m o d 1 6 , so the minimal n is at least 2 k − 3
Since n ≥ 3 , 2 k − 3 > k − 4 so the answer is 2 k − 3
In this particular case we have k = 2 0 1 7
⟹ n m i n = 2 ⋅ 2 0 1 7 − 3 = 4 0 3 1
FYI You should define terms / variables before using them. It is hard to phrase what your first case is, and I only understood when I looked at the general case.
Here are the first 307 stable digits. We need to raise 17 to the power of 17 only 307 times The formula you developed is not minimal as I reported In fact, the logic used in the proof gives a bound to n but not the smallest value.
5107279372967984947900403975982049411742453302121449749395881706714897057361015870062793953395075122582350464052141094476381289780976882251792367786482612939220805814970195274745695085455170303734459544289785840831572423723078836315718561614186788278078398467943619327051293165692847290823289107359720085777
I may give the 2017 digits later
Log in to reply
To confirm, you believe the answer is 307?
I agree with your report that 4031 satisfies the conditions, but it is most likely not the minimum.
Log in to reply
For 307 the answer happens to be 307 I suspect the answer will be 2017 for the case of 2017
I didn't prove it formally. This is the result of computer calculations. I need to resolve an overflow problem for greater values bigger than 307
Log in to reply
@Mr X – Ah, I see that's what you mean.
Good luck resolving the overflow. Keep me updated :)
Log in to reply
@Calvin Lin – It is formal. The answer is 2017. Proved formally and calculated by computer The first 2017 digits are stable when n=2017 and NOT 4031
9043916840750404329173256208781505940564043118000462361983775912634826012242383635262875767008723337708536739594089475445559723246674687894534878718275386925214720216977233791511710277333434566292668280317915314472466961493204395934292136340205799477244823788140753553187743788502308933332512007070743665143677877548116818556373410930740448680041016813976825443200548664330251325654504983618885553317166221688446171703290790514810141650839637025433762696682516149739376715546273123246552299531884355981650740539426456001111105911855218595437287919121769751374522521501876013136095591734524896245116651752348091540736598281955696172189784686219907369981962399400423004752831651050633809517975754401462099942101561837321920775644499073834391653326144003220443936752431791804173878603088096971916972995420626590228626977322099599121073776753894169103331829852440399871102214942633875477880470215162010231498823688972783979673953200762156952043010533451479053590280410007130178893897229506922212464560876255639146869261619559924860903149576944017179639059832230504077025785521216964889264242553448625928108115887505739993837972692752678029759140647409187488671411040451830616070710533902142608341342619668393366408843763976427312525244850378491629440651604743250041076884901469064277364166761809976916499451988412331094083977236121957706141590263608967097535618856861582457457367339001278800838484157264627400713671451466963945049793958981940414533875588312725489135199985915515078149752117497228781501767197084117944346748499921882170798272438665456293599103543280116218306515397605933904886310934825969137448605302465022513653210649062419035014657782117747528205488554897233379628123708393240747233152439259704245107279372967984947900403975982049411742453302121449749395881706714897057361015870062793953395075122582350464052141094476381289780976882251792367786482612939220805814970195274745695085455170303734459544289785840831572423723078836315718561614186788278078398467943619327051293165692847290823289107359720085777
There is another admin of the page who marked the report as resolved. I will not report it again but the answer is 2017 and not 4031
Problem Loading...
Note Loading...
Set Loading...
Let p be an odd prime, and let g be a positive integer which is a primitive root modulo p , and such that g p − 1 ≡ 1 ( m o d p 2 ) .
This is proved by induction. The case k = 1 is given. Suppose that k ≥ 1 . If g ϕ ( p k ) ≡ 1 ( m o d p k + 1 ) then it follows that g ϕ ( p k ) = 1 + u p k where p does not divide u . Since ϕ ( p k + 1 ) = p ϕ ( p k ) , we deduce that g ϕ ( p k + 1 ) = ( 1 + u p k ) p ≡ 1 + u p k + 1 ( m o d p k + 2 ) and hence g ϕ ( p k + 1 ) ≡ 1 ( m o d p k + 2 ) . The result follows by induction.
The case k = 1 is given. Suppose now that k ≥ 1 and that the order of g modulo p k is ϕ ( p k ) . Let x be the order of g modulo p k + 1 . Then g x ≡ 1 ( m o d p k + 1 ) , and so g x ≡ 1 ( m o d p k ) , so that ϕ ( p k ) divides x . On the other hand x must divide ϕ ( p k + 1 ) = p ϕ ( p k ) . From Claim 1 we know that x = ϕ ( p k ) , and hence we deduce that x = ϕ ( p k + 1 ) . The result follows by induction.
Note that T 1 − T 0 = 1 6 = 2 4 . Suppose that T k + 1 ≡ T k ( m o d 2 k + 4 ) . Then T k + 1 ≡ T k ( m o d ϕ ( 2 k + 5 ) ) , and hence T k + 2 = 1 7 T k + 1 ≡ 1 7 T k = T k + 1 ( m o d 2 k + 5 ) . Thus we deduce by induction that T k + 1 ≡ T k ( m o d 2 k + 4 ) for all k ≥ 0 .
Suppose that T k + 1 ≡ T k ( m o d 4 × 5 k ) . Then T k + 1 ≡ T k ( m o d ϕ ( 5 k + 1 ) ) , and hence T k + 2 = 1 7 T k + 1 ≡ 1 7 T k = T k + 1 ( m o d 5 k + 1 ) . Since T k + 2 ≡ T k + 1 ≡ 1 ( m o d 4 ) , we deduce that T k + 2 ≡ T k + 1 ( m o d 4 × 5 k + 1 ) . Since the ground step is trivial, we have shown by induction that T k + 1 ≡ T k ( m o d 4 × 5 k ) for all k ≥ 0 .
Thus we deduce that T k + 1 ≡ T k ( m o d 1 0 k ) for all k ≥ 0 , and hence that T k ≡ T 2 0 1 7 ( m o d 1 0 2 0 1 7 ) for all k ≥ 2 0 1 7 .
Suppose it was true that T 2 0 1 7 ≡ T 2 0 1 6 ( m o d 1 0 2 0 1 7 ) . Then we know that T 2 0 1 7 ≡ T 2 0 1 6 ( m o d 5 2 0 1 7 ) , and so 1 7 T 2 0 1 6 ≡ 1 7 T 2 0 1 5 ( m o d 5 2 0 1 7 ) . Since 1 7 is a primitive root modulo 5 2 0 1 7 , we deduce that T 2 0 1 6 ≡ T 2 0 1 5 ( m o d ϕ ( 5 2 0 1 7 ) ) , and hence T 2 0 1 6 ≡ T 2 0 1 5 ( m o d 5 2 0 1 6 ) . This in turn would imply that T 2 0 1 5 ≡ T 2 0 1 4 ( m o d 5 2 0 1 5 ) , and so T 2 0 1 4 ≡ T 2 0 1 3 ( m o d 5 2 0 1 4 ) . Continuing down inductively, we deduce that T 1 ≡ T 0 ( m o d 5 ) , which is not true. Thus it is not the case that T 2 0 1 7 ≡ T 2 0 1 6 ( m o d 1 0 2 0 1 7 ) , and so the answer to the question is 2 0 1 7 .
More generally, the smallest integer n such that T m ≡ T n ( m o d 1 0 k ) for all m ≥ n is k .