Last two digits??

f ( x ) = x x x x \Large f(x) =x^{x^{x^{x}}}

For f ( x ) f(x) as defined above, find the last two digits of f ( 17 ) + f ( 18 ) + f ( 19 ) + f ( 20 ) f(17)+f(18)+f(19)+f(20) .


The answer is 32.

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.

2 solutions

Let us consider the four f ( x ) m o d 100 f(x) \bmod 100 separately. Since gcd ( 17 , 100 ) = 1 \gcd(17, 100) = 1 , we can apply Euler's theorem and use Carmichael's lambda function λ ( ) \lambda (\cdot) . Note that λ ( 100 ) = 20 \lambda (100) = 20 and λ ( 20 ) = 4 \lambda (20) = 4 . Then

f ( 17 ) 1 7 1 7 1 7 17 m o d 4 m o d 20 (mod 100) 1 7 1 7 ( 16 + 1 ) 17 m o d 4 m o d 20 (mod 100) 1 7 1 7 1 m o d 20 (mod 100) 1 7 17 (mod 100) 17 ( 289 ) 8 (mod 100) 17 ( 90 1 ) 8 (mod 100) 17 ( 720 + 1 ) (mod 100) 17 ( 19 ) (mod 100) 23 (mod 100) 77 (mod 100) \begin{aligned} f(17) & \equiv 17^{17^{17^{17} \bmod 4} \bmod 20} \text{ (mod 100)} \\ & \equiv 17^{17^{(16+1)^{17} \bmod 4} \bmod 20} \text{ (mod 100)} \\ & \equiv 17^{17^1 \bmod 20} \text{ (mod 100)} \\ & \equiv 17^{17} \text{ (mod 100)} \\ & \equiv 17(289)^8 \text{ (mod 100)} \\ & \equiv 17(90-1)^8 \text{ (mod 100)} \\ & \equiv 17(-720+1) \text{ (mod 100)} \\ & \equiv 17(-19) \text{ (mod 100)} \\ & \equiv -23 \text{ (mod 100)} \\ & \equiv 77 \text{ (mod 100)} \end{aligned}

Since gcd ( 18 , 100 ) 1 \gcd(18, 100) \ne 1 , we have to use Chinese remainder theorem and consider f ( 18 ) m o d 4 f(18) \bmod 4 and f ( 18 ) m o d 25 f(18) \bmod 25 separately.

  • First f ( 18 ) 0 (mod 4) f(18) \equiv 0 \text{ (mod 4)} . Then, since gcd ( 18 , 25 ) \gcd(18, 25) , Euler's theorem applies and Euler's totient function ϕ ( 25 ) = 20 \phi (25) = 20 . Then f ( 18 ) 1 8 1 8 1 8 18 m o d 20 (mod 25) f(18) \equiv 18^{18^{18^{18}} \bmod 20} \text{ (mod 25)} . But gcd ( 18 , 20 ) 1 \gcd(18,20) \ne 1 , we have to consider g ( 18 ) = 1 8 1 8 18 m o d 20 g(18) = 18^{18^{18}} \bmod 20 using Chinese remainder theorem.
  • Again g ( 18 ) 1 8 1 8 18 0 (mod 4) g(18) \equiv 18^{18^{18}} \equiv 0 \text{ (mod 4)} . And g ( 18 ) 1 8 1 8 18 3 1 8 18 m o d ϕ ( 5 ) 3 1 8 18 m o d 4 3 2 18 m o d 4 3 0 1 (mod 5) g(18) \equiv 18^{18^{18}} \equiv 3^{18^{18} \mod \phi (5)} \equiv 3^{18^{18} \mod 4} \equiv 3^{2^{18} \mod 4} \equiv 3^0 \equiv 1 \text{ (mod 5)} . Then g ( 18 ) 5 n + 1 0 (mod 4) n 3 g(18) \equiv 5n + 1 \equiv 0 \text{ (mod 4)} \implies n \equiv 3 and g ( 18 ) 16 g(18) \equiv 16 .
  • Then f ( 18 ) 1 8 16 ( 7 ) 16 7 16 ( 50 1 ) 8 1 (mod 25) f(18) \equiv 18^{16} \equiv (-7)^{16} \equiv 7^{16} \equiv (50-1)^8 \equiv 1 \text{ (mod 25)} .
  • Hence, f ( 18 ) 25 n + 1 0 (mod 4) n 3 f(18) \equiv 25n + 1 \equiv 0 \text{ (mod 4)} \implies n \equiv 3 and f ( 18 ) 76 (mod 100) f(18) \equiv 76 \text{ (mod 100)} .

f ( 19 ) 1 9 1 9 1 9 19 m o d λ ( 100 ) 1 9 ( 20 1 ) 1 9 19 m o d 20 1 9 19 (mod 100) ( 20 1 ) 19 ( 380 1 ) 79 (mod 100) \begin{aligned} f(19) & \equiv 19^{19^{19^{19}}\bmod \lambda(100)} \equiv 19^{(20-1)^{19^{19}}\bmod 20} \equiv 19^{19} \text{ (mod 100)} \\ & \equiv (20-1)^{19} \equiv (380 - 1) \equiv 79 \text{ (mod 100)} \end{aligned}

And f ( 20 ) 2 0 2 0 2 0 20 0 (mod 100) f(20) \equiv 20^{20^{20^{20}}} \equiv 0 \text{ (mod 100)}

Therefore, f ( 17 ) + f ( 18 ) + f ( 19 ) + f ( 20 ) = 77 + 76 + 79 + 0 32 (mod 100) f(17) + f(18) + f(19) + f(20) = 77 + 76 + 79+ 0 \equiv \boxed{32} \text{ (mod 100)} .

Thank you, I just have a question if possible, can it be solved in Python. I was trying to define the function but it was giving invalid syntax.

Hana Wehbi - 1 year, 3 months ago

Log in to reply

Obviously it can, any programming language can do too. But we have to handle the very big numbers. Python only provides 16-digit numbers. There can be module available for such big numbers.

Chew-Seong Cheong - 1 year, 3 months ago

@Hana Wehbi , like I have mentioned before, the objective in Brilliant is not just get the answer but learning math. Why take the trouble to do coding when Wolfram Alpha can solve the problems here. I suspect Kyle T has used software to solve the problem, because no steps are shown. If that is the case, it would be better for Kyle to mentioned the software at least everyone learn something extra from the problem.

My solution here give everyone a short course about Number Theory. I knew nothing about Number Theory before I joined Brilliant. Your problem is a good problem because I have used all the theories and techniques I have ever learnt about Number Theory and I have demonstrated the use here. Instead of asking about Number Theory, you asked me about Python coding. Sorry, I am assuming you know nothing about Number Theory.

Knowing Number Theory will make computing easier. That is why we learn about Number Theory. The number f ( 17 ) f(17) for example has 1 0 21 10^{21} digits. Even if there is no syntax error (you must have keyed in something not acceptable by Python), we need expertise to handle such big number. Using the techniques I show, we only need to handle effectively 2-digit number. Using Number Theory we only need to handle small numbers.

Chew-Seong Cheong - 1 year, 3 months ago

@Chew-Seong Cheong , thank you for a nice solution. The reason l asked because recently l am learning coding and l am trying to implement that in solving problems. There was nothing against your techniques and methods. Also, l know Number Theory, l solved this problem similar to yours, l will post my solution soon.

Hana Wehbi - 1 year, 3 months ago

Log in to reply

I was not saying you are against my solution. I was saying you seem to misunderstand the objective of Brilliant.org.

Chew-Seong Cheong - 1 year, 3 months ago
Hana Wehbi
Mar 4, 2020

This is my solution, I have definitely used Euler's Theorem

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...