fork(1) download
  1. from math import sqrt
  2.  
  3. def issumofsqcube(n, count=0, b=2):
  4. while (count <= 5 or b in range(2, 1 + int(pow(n - 4, 1/3)))):
  5. if isinstance(sqrt(n - pow(b, 3)), int):
  6. count = count + 1
  7. b = b + 1
  8. else:
  9. return count
  10.  
  11. print(issumofsqcube(5229225))
  12.  
  13.  
Success #stdin #stdout 0.02s 8736KB
stdin
Standard input is empty
stdout
0