Find prime numbers of the form n*n*n+2: Difference between revisions

Added Easylang
m (→‎{{header|Wren}}: Minor tidy)
(Added Easylang)
 
Line 693:
n = 173 => n^3 + 2 = 5177719
n = 189 => n^3 + 2 = 6751271</pre>
 
=={{header|EasyLang}}==
<syntaxhighlight>
fastfunc isprim num .
i = 2
while i <= sqrt num
if num mod i = 0
return 0
.
i += 1
.
return 1
.
for n = 1 to 199
p = pow n 3 + 2
if isprim p = 1
write p & " "
.
.
</syntaxhighlight>
{{out}}
<pre>
3 29 127 24391 91127 250049 274627 328511 357913 571789 1157627 1442899 1860869 2146691 2924209 3581579 5000213 5177719 6751271
</pre>
 
=={{header|F_Sharp|F#}}==
2,033

edits