6s - Problem 6

6 6 6 6 6 6 \Huge 6^{6^{6^{6^{6^6}}}}

Find the 6 th 6^\text{th} last digit from the right of the decimal representation of the above number.


The answer is 2.

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

Shaun Loong
Apr 10, 2014

The solution to the problem is x x where 6 6 6 6 6 6 x m o d 1 0 6 6^{6^{6^{6^{6^{6}}}}}\equiv x \mod 10^{6} . We see that gcd ( 6 6 6 6 6 6 , 1 0 6 ) 1 \gcd(6^{6^{6^{6^{6^{6}}}}},10^{6})\neq1 . Thus, we reduce this modulo by dividing each term by 2 6 2^{6} as proven on a separate note. With that, we obtain 6 6 6 6 6 6 2 6 x 2 6 m o d 5 6 \frac{6^{6^{6^{6^{6^{6}}}}}}{2^{6}}\equiv \frac{x}{2^{6}}\mod5^{6} . To solve this, we shall apply Euler's totient function repeatedly such that ϕ ( 5 n ) = 5 n 1 . 2 2 \phi (5^{n})=5^{n-1}.2^{2} and ϕ ( 5 n . 2 k ) = 5 n 1 . 2 k + 1 \phi (5^{n}.2^{k})=5^{n-1}.2^{k+1} . Hence: 6 6 6 6 6 6 2 6 x 2 6 m o d 5 6 \frac{6^{6^{6^{6^{6^{6}}}}}}{2^{6}}\equiv \frac{x}{2^{6}}\mod5^{6} 6 6 6 6 6 6 ( m o d 5 5 . 2 2 ) 2 6 x 2 6 m o d 5 6 \frac{6^{6^{6^{6^{6^{6}}}}(\mod5^{5}.2^{2})}}{2^{6}}\equiv \frac{x}{2^{6}}\mod5^{6} ** \textbf{**} Now, observe the index of 6 6 , which is 6 6 6 6 6 y m o d 5 5 . 2 2 6^{6^{6^{6^{6}}}}\equiv y\mod 5^{5}.2^{2} . As proven on a separate note, we can divide the terms by 2 2 2^{2} to obtain 6 6 6 6 6 2 2 y 2 2 m o d 5 5 \frac{6^{6^{6^{6^{6}}}}}{2^{2}}\equiv \frac{y}{2^{2}}\mod 5^{5} . Then, we apply the property of modulo arithmetic such that if a b m o d n a\equiv b\mod n , then k a k b m o d n ka\equiv kb\mod n for any integer k k . With that, we know that 6 6 6 6 6 2 2 y 2 2 m o d 5 5 6 6 6 6 6 y m o d 5 5 \frac{6^{6^{6^{6^{6}}}}}{2^{2}}\equiv \frac{y}{2^{2}}\mod 5^{5}\Rightarrow6^{6^{6^{6^{6}}}}\equiv y\mod 5^{5} . Take note that we do not use this technique on 6 6 6 6 6 6 2 6 x 2 6 m o d 5 6 \frac{6^{6^{6^{6^{6^{6}}}}}}{2^{6}}\equiv \frac{x}{2^{6}}\mod5^{6} so that we do not eliminate the 2 6 2^{6} . Doing so would result in finding congruence for 5 6 5^{6} and not 1 0 6 10^{6} . Hence we have: 6 6 6 6 6 6 ( m o d 5 5 . 2 2 ) 2 6 x 2 6 m o d 5 6 6 6 6 6 6 6 ( m o d 5 5 ) 2 6 x 2 6 m o d 5 6 \frac{6^{6^{6^{6^{6^{6}}}}(\mod5^{5}.2^{2})}}{2^{6}}\equiv \frac{x}{2^{6}}\mod5^{6}\Rightarrow \frac{6^{6^{6^{6^{6^{6}}}}(\mod5^{5})}}{2^{6}}\equiv \frac{x}{2^{6}}\mod5^{6} Repeating this steps above (indicated with ** \textbf{**} )over and over again, we eventually get: 6 6 6 6 6 6 ( m o d 5 ) ( m o d 5 2 ) ( m o d 5 3 ) ( m o d 5 4 ) ( m o d 5 5 ) 2 6 x 2 6 m o d 5 6 \frac{6^{6^{6^{6^{6^{6(\mod5)}(\mod5^{2})}(\mod5^{3})}(\mod5^{4})}(\mod5^{5})}}{2^{6}}\equiv \frac{x}{2^{6}}\mod5^{6} Then, we shall solve this step by step: 6 6 6 6 6 1 ( m o d 5 2 ) ( m o d 5 3 ) ( m o d 5 4 ) ( m o d 5 5 ) 2 6 x 2 6 m o d 5 6 \frac{6^{6^{6^{6^{6^{1}(\mod5^{2})}(\mod5^{3})}(\mod5^{4})}(\mod5^{5})}}{2^{6}}\equiv \frac{x}{2^{6}}\mod5^{6} 6 6 6 6 6 ( m o d 5 3 ) ( m o d 5 4 ) ( m o d 5 5 ) 2 6 x 2 6 m o d 5 6 \frac{6^{6^{6^{6^{6}(\mod5^{3})}(\mod5^{4})}(\mod5^{5})}}{2^{6}}\equiv \frac{x}{2^{6}}\mod5^{6} 6 6 6 31 ( m o d 5 4 ) ( m o d 5 5 ) 2 6 x 2 6 m o d 5 6 \frac{6^{6^{6^{31}(\mod5^{4})}(\mod5^{5})}}{2^{6}}\equiv \frac{x}{2^{6}}\mod5^{6} 6 6 531 ( m o d 5 5 ) 2 6 x 2 6 m o d 5 6 \frac{6^{6^{531}(\mod5^{5})}}{2^{6}}\equiv \frac{x}{2^{6}}\mod5^{6} 6 1156 2 6 x 2 6 m o d 5 6 2 1150 . 3 1156 x 2 6 m o d 5 6 \frac{6^{1156}}{2^{6}}\equiv \frac{x}{2^{6}}\mod5^{6}\Rightarrow2^{1150}.3^{1156}\equiv \frac{x}{2^{6}}\mod5^{6} Since 2 1150 5374 m o d 5 6 2^{1150}\equiv 5374\mod 5^{6} and 3 1156 15396 m o d 5 6 3^{1156}\equiv 15396\mod 5^{6} , we know that 2 1150 . 3 1156 3729 m o d 5 6 2^{1150}.3^{1156}\equiv 3729\mod5^{6} . Therefore, x 2 6 = 3729 \frac{x}{2^{6}}=3729 .

Finally, we compute our desired answer, x x to be x = 3729 × 2 6 = 238656 x=3729\times2^{6}=238656 . The 6 6 th digit from the right of 6 6 6 6 6 6 6^{6^{6^{6^{6^{6}}}}} is 2 \boxed{2} .

Proofs and workings used in solution \textbf{Proofs and workings used in solution}

1 1 . If m n m o d k m\equiv n\mod k with gcd ( m , n , k ) = b \gcd(m,n,k)=b , then m b n b m o d k b \frac{m}{b}\equiv\frac{n}{b}\mod\frac{k}{b} . This property is valid because by mathematical reasoning, if ( m n ) (m-n) divisible by k k , then obviously m n b \frac{m-n}{b} is divisible by k b \frac{k}{b} . Alternatively, we may also proof this by observing that since m n k = z \frac{m-n}{k}=z where z z is an integer, then obviously m n k = m n b k b = z \frac{m-n}{k}=\frac{\frac{m-n}{b}}{\frac{k}{b}}=z , and this completes the proof.

2 2 . Finding remainder when 6 4 6^{4} divided by 5 3 5^{3} . 6 4 46 m o d 5 3 6^{4}\equiv 46\mod5^{3} 6 2 36 m o d 5 3 6^{2}\equiv36\mod5^{3} So, 6 6 = 46 × 36 = 1656 31 m o d 5 3 6^{6}=46\times36=1656\equiv31\mod5^{3} .

3 3 . Similarly, finding remainder when 6 31 6^{31} divide 5 4 5^{4} . 6 4 46 m o d 5 4 6^{4}\equiv46\mod5^{4} 6 3 216 m o d 54 6^{3}\equiv216\mod5{4} Hence, 6 31 = ( 6 4 ) 7 × 6 3 4 6 7 × 216 m o d 5 4 6^{31}=(6^{4})^{7}\times6^{3}\equiv46^{7}\times216 \mod5^{4} . Then, 4 6 2 241 m o d 5 4 46^{2}\equiv241\mod5^{4} and hence, 6 31 24 1 3 × 46 × 216 m o d 5 4 6^{31}\equiv241^{3}\times46\times216\mod5^{4} . 24 1 2 581 m o d 5 4 241^{2}\equiv581\mod5^{4} 6 31 581 × 241 × 46 × 216 m o d 5 4 581 × 241 × 46 × 216 531 m o d 5 4 6^{31}\equiv581\times241\times46\times216 \mod5^{4}\Rightarrow581\times241\times46\times216\equiv531\mod5^{4} 6 31 531 m o d 5 4 \therefore 6^{31}\equiv531 \mod 5^{4} Using these same steps as above, we can find 6 531 m o d 5 5 6^{531} \mod5^{5} , 2 1150 m o d 5 6 2^{1150}\mod5^{6} and 3 1156 m o d 5 6 3^{1156}\mod5^{6} .

It is not clear to me why you wanted to find x 2 6 ( m o d 5 6 ) \frac{ x}{2^6} \pmod{5^6} . You can just find x ( m o d 5 6 ) x \pmod{5^6} and x ( m o d 2 6 ) x \pmod{2^6 } , and then apply Chinese Remainder Theorem.

Calvin Lin Staff - 7 years, 2 months ago

Log in to reply

Calvin, can you show a solution to this using CRT?

Michael Munta - 2 years, 5 months ago

Yes that is possible as well, its just that I prefer to approach all modulo arithmetic questions using this method. :)

Shaun Loong - 7 years, 2 months ago

can we solve through shortcut method? i couldn't understand...

Bishnupriya Parichha - 4 years, 9 months ago

Why do you even show this: ϕ ( 5 n . 2 k ) = 5 n 1 . 2 k + 1 \phi (5^{n}.2^{k})=5^{n-1}.2^{k+1} ? You never actually use it because your iteration step prevents you from getting to that.

Michael Munta - 2 years, 5 months ago

There might be a flaw in the iteration step (**), even though it does not change the result. You claim essentially:

x m o d 2 2 0 ( x m o d 5 k 1 2 2 ) ( x m o d 5 k 1 ) m o d 5 k x\mod 2^2 \equiv 0\quad\Rightarrow \quad \left(x \mod 5^{k-1}\cdot 2^2\right)\equiv \left(x\mod 5^{k-1}\right)\mod 5^k

Counterexample: x = 28 ; k = 2 x=28;\:k=2 yields 8 ≢ 3 m o d 25 8\not\equiv 3\mod 25

However, for the tetration x = k 1 6 x={}^{k-1} 6 the claim holds - but to see that, you need to know 6 5 k 1 1 m o d 5 k , 5 k 1 < 2 2 5 k 1 = ϕ ( 5 k ) , k 1 6^{5^{k-1}}\equiv 1\mod 5^k,\qquad 5^{k-1}<2^2\cdot 5^{k-1}=\phi(5^k),\qquad k\geq 1

is another, even shorter cycle length than the worst case estimate we get with Euler's Totient. If we know that, we can safely ignore the extra factors of 4, because they will not matter anyway: The shorter cycle will just repeat the first 5 k 1 5^{k-1} values.

For the relevant k 6 k\leq 6 , we really have this shorter cycle length (checked via program) and it actually is the minimum cycle length each time! So in this particular problem it does not matter that we ignore the factors of 4 - but how can we know we may do that, without resorting to brute force?

Carsten Meyer - 1 year, 1 month ago
Max B
Apr 8, 2014

can we apply log

not at all

Satvik Golechha - 6 years, 9 months ago

Log in to reply

can we apply wolfram alpha

math man - 6 years, 7 months ago
Carsten Meyer
May 9, 2020

To get the sixth digit on the right of the tetration 6 6 {}^6 6 , we need all of the last six digits. We can extract them using r 6 6 6 m o d 1 0 6 \begin{aligned} r_6&\equiv {}^6 6\mod 10^6 \end{aligned} Instead of doing that directly, it will be more helpful to prove the following solution to a (slightly) more general problem: r k k 6 m o d 2 i 5 k r k 0 m o d 2 i r k 6 r k 1 m o d 5 k r k 1 k 1 6 m o d 2 2 5 k 1 , i , k N , 2 i k ( 1 ) \begin{aligned} r_k&\equiv {}^k{6}\mod 2^i\cdot 5^k&&&\Leftrightarrow &&&& \begin{aligned} r_k&\equiv 0\mod 2^i\\ r_k&\equiv 6^{r_{k-1}}\mod 5^k \end{aligned}&&&&r_{k-1}&\equiv {}^{k-1} 6 \mod 2^2\cdot 5^{k-1},&&&i,\:k&\in\mathbb{N},& 2&\leq i\leq k&&&&&(1) \end{aligned} We notice: The congruence we have to solve for r k 1 r_{k-1} is of the same form as before, but the tetration is smaller!


Proof: We want to reduce the enormous exponential k 6 {}^k6 with Euler's Theorem . Sadly, gcd ( 6 , 2 i 5 k ) = 2 \gcd(6,\:2^i\cdot 5^k)=2 , so we cannot use it directly! Instead we work with the Chinese Remainder Theorem, as gcd ( 2 i , 5 k ) = 1 \gcd(2^i,\:5^k)=1 : r k k 6 m o d 2 i 5 k r k k 6 m o d 2 i r k k 6 m o d 5 k k 1 6 k i gcd ( k 6 , 2 i 5 k ) = gcd ( 6 k 1 6 , 2 i 5 k ) = 2 i \begin{aligned} r_k&\equiv {}^k 6\mod 2^i\cdot 5^k&&&\Leftrightarrow&&&&\begin{aligned} r_k&\equiv {}^k 6\mod 2^i\\ r_k&\equiv {}^k 6\mod 5^k \end{aligned}&&&&&&\left|\: {}^{k-1} 6\geq k\geq i\right.&&\Rightarrow&&\gcd({}^k 6,\:2^i\cdot 5^k)&=\gcd(6^{{}^{k-1} 6},\:2^i\cdot 5^k)=2^i \end{aligned} The first congruence is simply zero: We already know 2 i 2^i is a factor of k 6 {}^k 6 . The second congurence is harder, but now we can use Euler's Theorem as gcd ( 6 , 5 k ) = 1 \gcd(6,\:5^k)=1 . The idea is to write the exponent k 1 6 {}^{k-1} 6 in terms of ϕ ( 5 k ) = 2 2 5 k 1 \phi(5^k)=2^{2}\cdot 5^{k-1} : k 1 6 = ! c ϕ ( 5 k ) + r k 1 , c Z r k k 6 6 k 1 6 6 c ϕ ( 5 k ) 6 r k 1 1 c 6 r k 1 6 r k 1 m o d 5 k \begin{aligned} {}^{k-1} 6&\overset{!}{=}c\phi(5^k)+r_{k-1}, &c&\in\mathbb{Z} &&&\Rightarrow&&&& r_k&\equiv {}^k 6\equiv 6^{{}^{k-1} 6}\equiv 6^{c\phi(5^k)}\cdot 6^{r_{k-1}}\equiv 1^{c}\cdot 6^{r_{k-1}}\equiv 6^{r_{k-1}}\mod 5^k&&&\blacksquare \end{aligned}


To solve the original problem, we factor 1 0 6 = 2 6 5 6 10^6=2^6\cdot 5^6 and use (1) repeatedly to get down to 1 6 = 6 {}^1 6=6 : r 6 0 m o d 2 6 r 6 6 r 5 m o d 5 6 r k 0 m o d 2 2 r k 6 r k 1 m o d 5 k k { 2 ; ; 5 } r 1 6 m o d 20 \begin{aligned} \begin{aligned} r_6&\equiv 0\mod 2^6\\ r_6&\equiv 6^{r_5}\mod 5^6 \end{aligned}&&&&&&\begin{aligned} r_k&\equiv 0\mod 2^2\\ r_k&\equiv 6^{r_{k-1}}\mod 5^k \end{aligned}&&k&\in\{2;\:\ldots;\:5\}&&&&&r_1&\equiv 6\mod 20 \end{aligned} Though it is tedious, we can solve these six systems of congruences by hand using the power method (see reply), starting with r 1 r_1 and ending with r 6 r_6 . The results are listed below, the sixth digit on the right of r 6 r_6 is the answer: k 1 2 3 4 5 6 r k 6 56 156 1156 1156 2 38656 \begin{array}{r|rrrrrr} k & 1 & 2 & 3 & 4 & 5 & 6\\\hline r_k & 6 & 56 & 156 & 1156 & 1156 & \boxed{2}38656 \end{array}

Rem.: As an example, we will calculate r 3 r_3 using the power method. We write the exponent r 2 r_2 in powers of 2: r 3 6 r 2 6 56 6 8 6 16 6 32 ( ) ( 9 ) 81 61 ( 9 ) 4941 ( 9 ) ( 59 ) 31 m o d 5 3 \begin{aligned} r_3\equiv 6^{r_2}&\equiv 6^{56}\equiv 6^{8}\cdot 6^{16}\cdot 6^{32}\underset{(*)}{\equiv} (-9)\cdot 81\cdot 61\equiv(-9)\cdot 4941\equiv (-9)\cdot (-59)\equiv 31\mod 5^3 \end{aligned} We get the powers 6 2 k 6^{2^k} by squaring repeatedly - that's why it's called the power method: 6 4 3 6 2 1296 46 m o d 5 3 , 6 16 ( 9 ) 2 81 m o d 5 3 6 8 4 6 2 2116 9 m o d 5 3 , 6 32 8 1 2 6561 61 m o d 5 3 ( ) \begin{aligned} \begin{aligned} 6^4&\equiv 36^2\equiv 1296\equiv 46\mod 5^3, &&& 6^{16}&\equiv (-9)^2\equiv 81\mod 5^3\\ 6^8&\equiv 46^2\equiv 2116\equiv -9\mod 5^3, &&& 6^{32}&\equiv 81^2\equiv 6561\equiv 61\mod 5^3 \end{aligned}&&&&(*) \end{aligned} Finally we combine the result with the other congruence for r 3 r_3 to build a diophantine equation: r 3 0 m o d 2 2 r 3 31 m o d 5 3 r 3 = 4 x r 3 = 31 + 125 y } 31 = 4 x 125 y , x , y Z \begin{aligned} \begin{aligned} r_3&\equiv 0\mod 2^2\\ r_3&\equiv 31\mod 5^3 \end{aligned}&&&&\Leftrightarrow&&&&\left.\begin{aligned} r_3&=4x\\ r_3&=31+125y \end{aligned}\right\}&& 31&=4x-125y,&&& x,\:y&\in\mathbb{Z} \end{aligned} Using Euclid's Algorithm, we find the solution. We shift the index k = k + 4 k=k'+4 to get to smaller numbers: ( x y ) = ( 31 125 1 4 ) ( 31 k ) r 3 = 4 x = 4 961 + 1000 k = 156 + 1000 k \begin{aligned}\begin{pmatrix}x\\y\end{pmatrix}&=\begin{pmatrix} -31&125\\ -1&4 \end{pmatrix}\begin{pmatrix}31\\k\end{pmatrix}&&&\Rightarrow &&&&r_3&=4x=-4\cdot 961+1000k=156+1000k' \end{aligned}

Have fun with r 4 , r 5 , r 6 r_4,\:r_5,\:r_6 !

Carsten Meyer - 1 year, 1 month ago

1 pending report

Vote up reports you agree with

×

Problem Loading...

Note Loading...

Set Loading...