fork download
  1. import time; max=10001; n=1; p=1; # PRIME_numb.py DANILIN
  2. while n<=max: # 78081 994271 45 seconds
  3. f=0; j=2; s = int(p**0.5) # https://r...content-available-to-author-only...r.com/AAOHQ6342
  4. while f < 1:
  5. if j >= s:
  6. f=2
  7. if p % j == 0:
  8. f=1
  9. j+=1
  10. if f != 1:
  11. n+=1;
  12. #print(n,p);
  13. p+=1
  14. print(n-1,p-1)
  15. print(time.perf_counter())
  16.  
Success #stdin #stdout 1.13s 14104KB
stdin
Standard input is empty
stdout
10001 104743
39551754.80461868