fork download
  1. python_code='
  2.  
  3. n=input();b=1
  4. while b<n-2:
  5. m=n;r=0;b+=1
  6. while m/(r!=n):r=r*b+m%b;m/=b
  7.  
  8. '
  9.  
  10. for test_case in \
  11. 0 1 2 3 4 6 11 19 47 53 79 103 389 997 1459 \
  12. 5 7 8 9 10 13 16 43 48 61 62 101 113 211 1361
  13. do
  14. printf '%4d ' $test_case
  15. if python -c "$python_code" <<< $test_case; then
  16. echo true
  17. else
  18. echo false
  19. fi
  20. done 2>&-
Success #stdin #stdout 0s 9024KB
stdin
Standard input is empty
stdout
   0 true
   1 true
   2 true
   3 true
   4 true
   6 true
  11 true
  19 true
  47 true
  53 true
  79 true
 103 true
 389 true
 997 true
1459 true
   5 false
   7 false
   8 false
   9 false
  10 false
  13 false
  16 false
  43 false
  48 false
  61 false
  62 false
 101 false
 113 false
 211 false
1361 false