fork(5) download
  1. for input in 18,22,13,666,-265,0,1,4937775:
  2. n=m=input
  3. s=0
  4. for d in range(2,n):
  5. while n%d<1:n/=d;s+=sum(map(int,`d`))
  6. print input,":",n<m>s==sum(map(int,`m`))
Success #stdin #stdout 0.47s 9128KB
stdin
Standard input is empty
stdout
18 : False
22 : True
13 : False
666 : True
-265 : False
0 : False
1 : False
4937775 : True