Fortunate numbers: Difference between revisions

Add Factor
(Add Factor)
Line 21:
* [[oeis:A046066]] Fortunate numbers, sorted with duplicates removed
<br><br>
 
=={{header|Factor}}==
{{works with|Factor|0.99 2021-06-02}}
<lang factor>USING: grouping io kernel math math.factorials math.primes
math.ranges prettyprint sequences sets sorting ;
 
"First 50 distinct fortunate numbers:" print
75 [1,b] [
primorial dup next-prime 2dup - abs 1 =
[ next-prime ] when - abs
] map members natural-sort 50 head 10 group simple-table.</lang>
{{out}}
<pre>
First 50 distinct fortunate numbers:
3 5 7 13 17 19 23 37 47 59
61 67 71 79 89 101 103 107 109 127
151 157 163 167 191 197 199 223 229 233
239 271 277 283 293 307 311 313 331 353
373 379 383 397 401 409 419 421 439 443
</pre>
 
=={{header|Go}}==
1,827

edits