Last 3 digits of s q u a r e s q u a r e s q u a r e {square}^{{square}^{square}}

Find last 3 digits in decimal representation of:

96 1 16 9 9 \Large 961^{169^9}


The answer is 441.

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
Nov 20, 2017

96 1 16 9 9 96 1 16 9 9 m o d λ ( 1000 ) (mod 1000) Since gcd ( 961 , 1000 ) = 1 , Euler’s theorem applies. 96 1 16 9 9 m o d 100 (mod 1000) Carmichael lambda function λ ( 1000 ) = 100 96 1 6 9 9 m o d 100 (mod 1000) By modular inverse (see note) 96 1 29 3 1 2 × 29 (mod 1000) 3 1 58 (mod 1000) By modular inverse (see note) 441 \begin{aligned} 961^{169^9} & \equiv 961^{\color{#3D99F6}169^9 \bmod \lambda(1000)} \text{ (mod 1000)} & \small \color{#3D99F6} \text{Since }\gcd(961,1000) = 1 \text{, Euler's theorem applies.} \\ & \equiv 961^{\color{#3D99F6}169^9 \bmod 100} \text{ (mod 1000)} & \small \color{#3D99F6} \text{Carmichael lambda function }\lambda (1000) = 100 \\ & \equiv 961^{\color{#D61F06}69^9 \bmod 100} \text{ (mod 1000)} & \small \color{#D61F06} \text{By modular inverse (see note)} \\ & \equiv 961^{\color{#D61F06}29} \\ & \equiv 31^{2\times 29} \text{ (mod 1000)} \\ & \equiv 31^{58} \text{ (mod 1000)} & \small \color{#3D99F6} \text{By modular inverse (see note)} \\ & \equiv \boxed{441} \end{aligned}


Modular Inverse

Case 1: We note that 6 9 10 ( 70 1 ) 10 1 (mod 100) 69^{10} \equiv (70-1)^{10} \equiv 1 \text{ (mod 100)} 69 × 6 9 9 1 (mod 100) \implies 69 \times 69^9 \equiv 1 \text{ (mod 100)} . Let 6 9 9 m o d 100 = a b = 10 a + b 69^9 \bmod 100 = \overline{ab} = 10a+b , since 69 69 (mod 100) 69 \equiv 69 \text{ (mod 100)} , we have

69 ( 10 a + b ) 1 (mod 100) 90 a + 6 9 b 1 (mod 100) For RHS to end with 1, b must be 9 so that 9 × 9 = 8 1 9 0 a + 6 2 1 0 1 (mod 100) For tenth digit = 0, a must be 2 so that 9 × 2 + 2 = 2 0 6 9 9 a b 29 (mod 100) \begin{aligned} 69(10a+b) & \equiv 1 \text{ (mod 100)} \\ 90a + 6{\color{#D61F06}9b} & \equiv {\color{#D61F06}1} \text{ (mod 100)} & \small \color{#D61F06} \text{For RHS to end with 1, }b \text{ must be 9 so that }9 \times 9 = 8\boxed{1} \\ {\color{#D61F06}9}0{\color{#D61F06}a} + 6{\color{#D61F06}2}1 & \equiv {\color{#D61F06}0}1 \text{ (mod 100)} & \small \color{#D61F06} \text{For tenth digit = 0, }a \text{ must be 2 so that }9 \times 2 + 2 = 2\boxed{0} \\ \implies 69^9 & \equiv \overline{ab} \equiv 29 \text{ (mod 100)} \end{aligned}

Case 2: Similarly,

3 1 60 ( 30 + 1 ) 60 ( 30 × 60 + 1 ) 801 (mod 1000) \begin{aligned} 31^{60} & \equiv (30+1)^{60} \equiv (30\times 60+1) \equiv 801 \text{ (mod 1000)} \end{aligned}

3 1 2 3 1 58 801 (mod 1000) Let 3 1 58 m o d 1000 = p q r 961 ( 100 p + 10 q + r ) 801 (mod 1000) 100 p + 610 q + 96 1 r 80 1 (mod 1000) r = 1 , 1 × 1 = 1 100 p + 6 1 0 q + 9 6 1 8 0 1 (mod 1000) q = 4 , 1 × 4 + 6 = 1 0 100 p + 440 + 961 801 (mod 1000) 1 00 p + 4 01 8 01 (mod 1000) p = 4 , 1 × 4 + 4 = 8 3 1 58 441 (mod 1000) \begin{aligned} \implies 31^231^{58} & \equiv 801 \text{ (mod 1000)} & \small \color{#3D99F6} \text{Let }31^{58} \bmod 1000 = \overline{pqr} \\ 961(100p+10q+r) & \equiv 801 \text{ (mod 1000)} \\ 100p+610q+96{\color{#3D99F6}1r} & \equiv 80{\color{#3D99F6}1} \text{ (mod 1000)} & \small \color{#3D99F6} \implies r = 1, \ \because 1 \times 1 = \boxed{1} \\ 100p+6{\color{#3D99F6}1}0{\color{#3D99F6}q}+9{\color{#3D99F6}6}1 & \equiv 8{\color{#3D99F6}0}1 \text{ (mod 1000)} & \small \color{#3D99F6} \implies q = 4, \ \because 1 \times 4 + 6 = 1\boxed{0} \\ 100p + 440 + 961 & \equiv 801 \text{ (mod 1000)} \\ {\color{#3D99F6}1}00{\color{#3D99F6}p}+{\color{#3D99F6}4}01 & \equiv {\color{#3D99F6}8}01 \text{ (mod 1000)} & \small \color{#3D99F6} \implies p = 4, \ \because 1 \times 4 + 4 = \boxed{8} \\ \implies 31^{58} & \equiv 441 \text{ (mod 1000)} \end{aligned}

Thank you for an excellent solution, it is interesting to note that the answer is also a square

Mrigank Shekhar Pathak - 3 years, 6 months ago

Log in to reply

Now, I notice 441 = 2 1 2 441=21^2 . Excellent problem too. I, now, really know how to do modular inverse.

Chew-Seong Cheong - 3 years, 6 months ago

Very excellent!

I Gede Arya Raditya Parameswara - 3 years, 5 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...