fork(1) download
  1. f=lambda x,y,i=1:i**y%x<1or-~f(x,y,i+1)
  2. for i in [[26,2],[96,2],[32,3],[64,9],[27,3]]:
  3. print('%s -> %s'%(i,f(*i)))
Success #stdin #stdout 0.01s 9992KB
stdin
Standard input is empty
stdout
[26, 2] -> 26
[96, 2] -> 24
[32, 3] -> 4
[64, 9] -> 2
[27, 3] -> 3