how to compute the last 2 digits of $3^{3^{3^{3}}}$ to n times? Input $n$, output the last $2$ digits of the result.
n=1 03 3=3  
n=2 27 3^3=27  
n=3 87 3^27=7625597484987
n=4 ?? 3^7625597484987=??

Sorry guys, the formula given is $T_n=3^{T_{n-1}}$, I have updated the example.
I was asked this question during an interview, but I didn't have any clue. (The interviewer kind of gave me a hint that for $n>10$, the last $10$ digits of all results would be the same?)

These are the last 2 digits of $3^m$ for $m\in\{0..19\}$
01,03,09,27,81,43,29,87,61,83,49,47,41,23,69,07,21,63,89,67
Let's call this A: A[0]=01, A[1]=03, A[19]=67...

These numbers are repeated for every 20 numbers. i.e. $3^{20+x}$ mod 100=$3^x$ mod 100
Your sequence of numbers simplified is: $3^{3^{n-1}}$. 
For example for n=4: $a_4=((3^3)^3)^3=(3^3)^{3*3}=3^{3*3*3}$ using that $(x^a)^b=x^{ab}$
So, you just have to find the exponent modulo 20. i.e $3^{n-1}$ mod 20
These are the remainder (modulo 20) of $3^m$ for $m\in\{0..3\}$
1,3,9,7

These numbers are repeated for every 4 numbers. i.e. $3^{4+x}$ mod 20=$3^x$ mod 20
So what you need is: 


*

*A[1]=03 (=B[1])

*A[3]=27 (=B[2])

*A[9]=83 (=B[3])

*A[7]=87 (=B[0])


These numbers are repeated. So in order to find an answer for a given n, you will have to compute n mod 4 and then get B[n mod 4].
