until(print(sum(i=!N=input,9,r!=r=f(i,N%M=10^9))" "r),f(n,m)=lift(Mod(N\M,m)^if(n,f(n-1,m=eulerphi(m))+m,1)))
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page