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

Find the last 4 digits of the decimal representation of

144 4 14 4 4 . \Large 1444^{144^4}.


The answer is 2656.

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.

3 solutions

Relevant wiki: Euler's Theorem

Let N = 144 4 14 4 4 N = 1444^{144^4} , we need to find N m o d 10000 N \bmod 10000 . Since 1444 and 10000 are not coprime integers, we shall consider the factors 2 4 = 16 2^4 = 16 and 5 4 = 625 5^4 = 625 of 10000 separately using Chinese remainder theorem .

Consider factor 16: N 0 (mod 16) N \equiv 0 \text{ (mod 16)} .

Consider factor 625:

N 144 4 14 4 4 m o d ϕ ( 625 ) (mod 625) Since gcd ( 144 , 625 ) = 1 , Euler’s theorem applies. 144 4 14 4 4 m o d 500 (mod 625) Euler’s totient function ϕ ( 625 ) = 500 144 4 196 (mod 625) By modulo inverse (see note) ( 1000 + 444 ) 5 × 39 + 1 (mod 625) 44 4 195 ( 1444 ) (mod 625) 4 195 11 1 195 ( 194 ) (mod 625) ( 5 1 ) 125 + 70 ( 110 + 1 ) 125 + 70 ( 194 ) (mod 625) ( 1 ) 4 70 11 1 70 ( 194 ) (mod 625) ( 5 1 ) 70 ( 110 + 1 ) 70 ( 431 ) (mod 625) ( 70 ( 69 ) 5 2 2 70 ( 5 ) + 1 ) ( 70 ( 69 ) 11 0 2 2 + 70 ( 110 ) + 1 ) ( 431 ) (mod 625) ( 26 ) ( 451 ) ( 431 ) (mod 625) = 156 (mod 625) \begin{aligned} N & \equiv 1444^{\color{#3D99F6} 144^4 \bmod \phi (625)} \text{ (mod 625)} & \small \color{#3D99F6} \text{Since }\gcd(144, 625) = 1 \text{, Euler's theorem applies.} \\ & \equiv 1444^{\color{#3D99F6} 144^4 \bmod 500} \text{ (mod 625)} & \small \color{#3D99F6} \text{Euler's totient function }\phi(625) = 500 \\ & \equiv 1444^{\color{#3D99F6}196} \text{ (mod 625)} & \small \color{#3D99F6} \text{By modulo inverse (see note)} \\ & \equiv (1000+444)^{5\times 39+1} \text{ (mod 625)} \\ & \equiv 444^{195}(1444) \text{ (mod 625)} \\ & \equiv 4^{195}111^{195}(194) \text{ (mod 625)} \\ & \equiv (5-1)^{125+70}(110+1)^{125+70}(194) \text{ (mod 625)} \\ & \equiv (-1)4^{70}111^{70}(194) \text{ (mod 625)} \\ & \equiv (5-1)^{70}(110+1)^{70}(431) \text{ (mod 625)} \\ & \equiv \left(\frac {70(69)5^2}2 - 70(5) + 1\right) \left(\frac {70(69)110^2}2 + 70(110) + 1\right)(431) \text{ (mod 625)} \\ & \equiv (26)(451)(431) \text{ (mod 625)} \\ & = 156 \text{ (mod 625)} \end{aligned}

Therefore,

N 625 n + 156 where n Z 625 n + 156 0 (mod 16) n + 12 0 (mod 16) n 4 N 625 ( 4 ) + 156 (mod 10000) 2656 (mod 10000) \begin{aligned} N & \equiv 625n + 156 & \small \color{#3D99F6} \text{where }n \in \mathbb Z \\ \implies 625n + 156 & \equiv 0 \text{ (mod 16)} \\ n + 12 & \equiv 0 \text{ (mod 16)} \\ n & \equiv 4 \\ \implies N & \equiv 625(4) + 156 \text{ (mod 10000)} \\ & \equiv \boxed{2656} \text{ (mod 10000)} \end{aligned}


Note: 14 4 5 ( 100 + 44 ) 5 4 4 5 ( 45 1 ) 5 5 × 45 1 224 (mod 500) \begin{aligned} 144^5 & \equiv (100+44)^5 \equiv 44^5 \equiv (45-1)^5 \equiv 5\times 45 - 1 \equiv 224 \text{ (mod 500)} \end{aligned}

144 × 14 4 4 224 (mod 500) Let 14 4 4 a b c 100 a + 10 b + c (mod 500) 144 × a b c 224 (mod 500) 144 × a b 6 1440 a b + 86 4 (mod 500) 144 × a 96 14400 a + 138 24 (mod 500) 144 × 196 28 224 224 (mod 500) 14 4 4 196 (mod 500) \begin{aligned} \implies 144 \times \color{#3D99F6}144^4 & \equiv 224 \text{ (mod 500)} & \small \color{#3D99F6} \text{Let }144^4 \equiv \overline{abc} \equiv 100a+10b+c \text{ (mod 500)} \\ 144 \times \color{#3D99F6}\overline{abc} & \equiv {\color{#D61F06}224} \text{ (mod 500)} \\ 144 \times \overline{ab6} & \equiv 1440\overline{ab} + 86{\color{#D61F06}4} \text{ (mod 500)} \\ 144 \times \overline{a96} & \equiv 14400a + 138{\color{#D61F06}24} \text{ (mod 500)} \\ 144 \times 196 & \equiv 28{\color{#D61F06}224} \equiv 224 \text{ (mod 500)} \\ \implies 144^4 & \equiv 196 \text{ (mod 500)} \end{aligned}

What is ϕ \phi ?

. . - 2 months, 2 weeks ago

Log in to reply

Euler's totient function as mentioned. Check out this link .

Chew-Seong Cheong - 2 months, 2 weeks ago

Log in to reply

I've known ϕ \phi or φ \varphi to the golden ratio, 1 + 5 2 \displaystyle \frac { 1 + \sqrt { 5 } } { 2 } , which is a root of the quadratic equation, x 2 x 1 = 0 x ^ { 2 } - x - 1 = 0 , which is the ratio, x + 1 : x = x : 1 x + 1 : x = x : 1 .

. . - 2 months, 2 weeks ago

Log in to reply

@. . Well ϕ \phi can be used for others too. Here is obviously not golden ratio. It is ϕ ( ) \phi( \cdot) with brackets behind,

Chew-Seong Cheong - 2 months, 2 weeks ago
Razing Thunder
Jul 3, 2020
1
2
3
4
s='1444'
for i in range(1,5):
    s=str(int(s)**144)[-4::]
print(s)

Ken Mercado
Nov 21, 2017

The answer x x can be computed using x 144 4 14 4 4 ( m o d 10000 ) x \equiv 1444^{144^{4}} \pmod{10000}

A simple solution is just to consider 14 4 4 144^4 as 3 8 × 2 16 3^{8} \times 2^{16} so we can just square 1444 1444 sixteen times and cube it eight times performing modulo 10000 in each step. Modulo 10000 by hand is easy because it's just truncation. It will require 16 + 2 × 8 = 32 16 + 2 \times 8 = 32 4-digit multiplications. We can apply Euler's Theorem and Chinese Remainder Theorem to reduce the exponent, but it becomes a much more complicated procedure.

x 144 4 3 8 × 2 16 ( m o d 10000 ) x \equiv 1444^{3^{8} \times 2^{16}} \pmod{10000}

x 513 6 3 8 × 2 15 ( m o d 10000 ) x \equiv 5136^{3^{8} \times 2^{15}} \pmod{10000}

x 849 6 3 8 × 2 14 ( m o d 10000 ) x \equiv 8496^{3^{8} \times 2^{14}} \pmod{10000}

x 201 6 3 8 × 2 13 ( m o d 10000 ) x \equiv 2016^{3^{8} \times 2^{13}} \pmod{10000}

x 425 6 3 8 × 2 12 ( m o d 10000 ) x \equiv 4256^{3^{8} \times 2^{12}} \pmod{10000}

x 353 6 3 8 × 2 11 ( m o d 10000 ) x \equiv 3536^{3^{8} \times 2^{11}} \pmod{10000}

x 329 6 3 8 × 2 10 ( m o d 10000 ) x \equiv 3296^{3^{8} \times 2^{10}} \pmod{10000}

x 361 6 3 8 × 2 9 ( m o d 10000 ) x \equiv 3616^{3^{8} \times 2^{9}} \pmod{10000}

x 434 5 3 8 × 2 8 ( m o d 10000 ) x \equiv 4345^{3^{8} \times 2^{8}} \pmod{10000}

x 793 6 3 8 × 2 7 ( m o d 10000 ) x \equiv 7936^{3^{8} \times 2^{7}} \pmod{10000}

x 9 6 3 8 × 2 6 ( m o d 10000 ) x \equiv 96^{3^{8} \times 2^{6}} \pmod{10000}

x 921 6 3 8 × 2 5 ( m o d 10000 ) x \equiv 9216^{3^{8} \times 2^{5}} \pmod{10000}

x 465 6 3 8 × 2 4 ( m o d 10000 ) x \equiv 4656^{3^{8} \times 2^{4}} \pmod{10000}

x 833 6 3 8 × 2 3 ( m o d 10000 ) x \equiv 8336^{3^{8} \times 2^{3}} \pmod{10000}

x 889 6 3 8 × 2 2 ( m o d 10000 ) x \equiv 8896^{3^{8} \times 2^{2}} \pmod{10000}

x 881 6 3 8 × 2 1 ( m o d 10000 ) x \equiv 8816^{3^{8} \times 2^{1}} \pmod{10000}

x 185 6 3 8 ( m o d 10000 ) x \equiv 1856^{3^{8}} \pmod{10000}

Now we cube 8 times.

x 1 6 3 7 ( m o d 10000 ) x \equiv 16^{3^{7}} \pmod{10000}

x 409 6 3 6 ( m o d 10000 ) x \equiv 4096^{3^{6}} \pmod{10000}

x 673 6 3 5 ( m o d 10000 ) x \equiv 6736^{3^{5}} \pmod{10000}

x 625 6 3 4 ( m o d 10000 ) x \equiv 6256^{3^{4}} \pmod{10000}

x 521 6 3 3 ( m o d 10000 ) x \equiv 5216^{3^{3}} \pmod{10000}

x 769 6 3 2 ( m o d 10000 ) x \equiv 7696^{3^{2}} \pmod{10000}

x 953 6 3 1 ( m o d 10000 ) x \equiv 9536^{3^{1}} \pmod{10000}

x 2656 ( m o d 10000 ) x \equiv 2656 \pmod{10000}

add a comment

sumon sohail - 3 years, 6 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...