fork(2) download
  1. def isOddNumberPrime(n):
  2. for x in range(3, n, 2):
  3. if x * x > n: return True
  4. if n % x == 0: return False
  5.  
  6. p4m = [x**4 for x in range(3, 100, 2) if isOddNumberPrime(x)]
  7. ok = []
  8. LIM = 50000000
  9.  
  10. while True:
  11. i,x = min(enumerate(p4m), key = lambda x: x[1])
  12. if x > LIM: break
  13. ok.append(x)
  14. p4m[i] *= 2
  15.  
  16. l = 45000000
  17. r = 50000000
  18. print(sum(1 for x in ok if l <= x <= r))
Success #stdin #stdout 0.02s 9296KB
stdin
Standard input is empty
stdout
4