Find prime numbers of the form n*n*n+2: Difference between revisions
Find prime numbers of the form n*n*n+2 (view source)
Revision as of 04:23, 16 March 2021
, 3 years ago→{{header|Julia}}: add brief version
m (→{{header|Julia}}: add brief version) |
|||
Line 231:
The total found was 19.
</pre>
=== One-liner version ===
<lang julia>using Primes; println(filter(isprime, map(x -> x^3 + 2, 1:199)))</lang>{{out}}<pre>
[3, 29, 127, 24391, 91127, 250049, 274627, 328511, 357913, 571789, 1157627, 1442899, 1860869, 2146691, 2924209, 3581579, 5000213, 5177719, 6751271]</pre>
=={{header|Phix}}==
|