fork(2) download
  1. primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
  2. 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
  3. 73, 79, 83, 89, 97, 101, 103, 107, 109, 113,
  4. 127, 131, 137, 139, 149, 151, 157, 163, 167, 173,
  5. 179, 181, 191, 193, 197, 199, 211, 223, 227, 229,
  6. 233, 239, 241, 251, 257, 263, 269, 271, 277, 281,
  7. 283, 293, 307, 311, 313, 317]
  8.  
  9. def isPrime(x) :
  10. global primes
  11.  
  12. for p in primes :
  13. if x%p==0 :
  14. return False
  15. return True
  16.  
  17. v = 777
  18.  
  19. for a in range(0,10):
  20. for b in range(0,10):
  21. for x in [v*100+a*10+b, a*10000+v*10+b, a*10000+b*1000+v] :
  22. if isPrime(x) :
  23. print x
Success #stdin #stdout 0.01s 7852KB
stdin
Standard input is empty
stdout
1777
2777
77711
11777
77713
77719
19777
22777
77723
27773
26777
27779
77731
41777
77743
43777
44777
77747
47777
47777
47779
50777
57773
53777
77761
65777
67777
67777
68777
71777
77773
77773
76777
79777
80777
77783
83777
97771
94777
77797
97777
97777