fork download
  1. def isOddNumberPrime(n):
  2. for x in range(3, n, 2):
  3. if x*x > n:
  4. return True
  5. if n % x == 0:
  6. return False
  7.  
  8. p = [x for x in range(3, 100, 2) if isOddNumberPrime(x)]
  9. p4s = { x**4 for x in p }
  10.  
  11. l = 45000000
  12. r = 50000000
  13. res = []
  14.  
  15. for n in range(l, r+1):
  16. x = n
  17. while (x & 1) == 0:
  18. x >>= 1
  19. if x in p4s:
  20. res.append(n)
  21.  
  22. print(res)
Success #stdin #stdout 2.57s 14176KB
stdin
Standard input is empty
stdout
[45212176, 45265984, 47458321, 48469444]