Tetration Mod by rotary-o

while(0<1)println{val a=readLine split' '
def f(x:Int,m:Int):Int={var n,o=m
2 to'\xe3\x8d\xbf'map{i=>if(o%i<1)n-=n/i
while(o%i<1)o/=i}
n-=n/o%n
BigInt(a(0))modPow(if(x>0)n+f(x-1,n)else 1,m)toInt}
var i,j=1
while(j!={j=f(i,a(1)toInt)
j})i+=1
i+" "+j}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page