fork(4) download
  1. from math import sqrt
  2.  
  3. def is_prime(n):
  4. sqrtN = int(sqrt(n) + 1)
  5. for p in range(2, sqrtN+1):
  6. if (n/p).is_integer():
  7. return False
  8.  
  9. return True
  10.  
  11. def ddd():
  12. from sys import stdout
  13.  
  14. a, b = map(int, input().strip().split())
  15. stdout.write('\n'.join(map(str, filter(is_prime, range(max(2,a), b+1)))))
  16.  
  17.  
  18.  
  19. ddd()
Success #stdin #stdout 0.39s 9264KB
stdin
999999999847 999999999947
stdout
999999999847
999999999857
999999999863
999999999877
999999999899
999999999937