fork download
  1. f=lambda x,b=2:~-b*x in[i%b*~-b**(i/b)for i in range(b*x)]and b or f(x,-~b)%~-x
  2.  
  3. for x in 11, 23, 55, 90, 91:
  4. print x, '-->', f(x)
Success #stdin #stdout 0.06s 8968KB
stdin
Standard input is empty
stdout
11 --> 0
23 --> 0
55 --> 10
90 --> 14
91 --> 9