10001th prime: Difference between revisions
Content added Content deleted
(Added Gambas) |
imported>Maxima enthusiast No edit summary |
||
Line 792: | Line 792: | ||
<syntaxhighlight lang="mathematica">Prime[10001]</syntaxhighlight> |
<syntaxhighlight lang="mathematica">Prime[10001]</syntaxhighlight> |
||
{{out}}<pre> |
|||
104743 |
|||
</pre> |
|||
=={{header|Maxima}}== |
|||
<syntaxhighlight lang="maxima"> |
|||
primes_first_n(n) := ( |
|||
if n<=1 then |
|||
[] |
|||
else ( |
|||
L : [2], |
|||
for i:2 thru n do ( |
|||
L : append(L, [next_prime(last(L))]) |
|||
), |
|||
L |
|||
) |
|||
)$ |
|||
last(primes_first_n(10001)); |
|||
</syntaxhighlight> |
|||
{{out}}<pre> |
{{out}}<pre> |
||
104743 |
104743 |