10001th prime: Difference between revisions
Content added Content deleted
Line 532: | Line 532: | ||
=={{header|Python}}== |
=={{header|Python}}== |
||
<lang python>import time; max=10001; n=1; p=1; # |
<lang python>import time; max=10001; n=1; p=1; # PRIME_numb.py russian DANILIN |
||
while n<=max: # |
while n<=max: # 78081 994271 45 seconds |
||
f=0; j=2 # rextester.com/ |
f=0; j=2; s = int(p**0.5) # rextester.com/AAOHQ6342 |
||
while f < 1: |
while f < 1: |
||
if j >= |
if j >= s: |
||
f=2 |
f=2 |
||
if p % j == 0: |
if p % j == 0: |
||
Line 543: | Line 543: | ||
if f != 1: |
if f != 1: |
||
n+=1; |
n+=1; |
||
#print(n,p); |
#print(n,p); |
||
p+= |
p+=1 |
||
print(n-1,p- |
print(n-1,p-1) |
||
print(time.perf_counter())</lang> |
print(time.perf_counter())</lang> |
||
{{out}} |
{{out}} |