10001th prime: Difference between revisions

no edit summary
m (→‎{{header|RPL}}: simpler version)
imported>Chinhouse
No edit summary
Line 794:
104743
</pre>
 
 
=={{header|Maxima}}==
Line 813 ⟶ 814:
104743
</pre>
 
=={{header|MiniScript}}==
<syntaxhighlight lang="miniscript">
isPrime = function(n)
s = floor(n ^ 0.5)
for i in range(2, s)
if n % i == 0 then return false
end for
return true
end function
 
tt = time
c = 2
p = 2
lastPrime = 2
while c < 10001
p += 1
if isPrime(p) then
c += 1
end if
end while
print p
</syntaxhighlight>
{{out}}
<pre>
104743</pre>
 
=={{header|Nim}}==
Anonymous user