10001th prime: Difference between revisions

m
imported>Maxima enthusiast
No edit summary
Line 586:
=={{header|EasyLang}}==
<syntaxhighlight lang="easylang">
procfastfunc isPrime num . result .
result = 0
if num mod 2 = 0 and num > 2
breakreturn 10
.
for i = 3 step 2 to sqrt num
while i <= sqrt num
if num mod i = 0
breakreturn 20
.
i += 2
.
result =return 1
.
curPrime = 1
currentPrime = 2
for i = 21 to 10001
# Because 2 is the 1st prime number,
# We will start counting primes from the 2nd
for i = 2 to 10001
repeat
currentPrimecurPrime += 1
calluntil isPrime currentPrimecurPrime result= 1
until result = 1
.
.
print currentPrimecurPrime
</syntaxhighlight>
{{out}}
2,056

edits