Erdős-primes: Difference between revisions
Added Arturo implementation
Drkameleon (talk | contribs) (Added Arturo implementation) |
|||
Line 15:
:* the OEIS entry: [http://oeis.org/A064152 A064152 Erdos primes].
<br><br>
=={{header|Arturo}}==
<lang rebol>factorials: map 1..20 => [product 1..&]
erdos?: function [x][
if not? prime? x -> return false
loop factorials 'f [
if f >= x -> break
if prime? x - f -> return false
]
return true
]
loop split.every:10 select 2..2500 => erdos? 'a ->
print map a => [pad to :string & 5]</lang>
{{out}}
<pre> 2 101 211 367 409 419 461 557 673 709
769 937 967 1009 1201 1259 1709 1831 1889 2141
2221 2309 2351 2411 2437</pre>
=={{header|AWK}}==
Line 62 ⟶ 84:
Erdos prime 7875: 999721
</pre>
=={{header|C++}}==
{{libheader|Primesieve}}
|