De Polignac numbers: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (New draft task and Raku example) |
(J) |
||
Line 28: | Line 28: | ||
=={{header|J}}== |
|||
Implementation: |
|||
<syntaxhighlight lang=J>depolignac=: (1+i.@>.&.-:) -. (i.@>.&.(2&^.)) ,@:(+/) i.&.(p:inv)</syntaxhighlight> |
|||
Task example: |
|||
<syntaxhighlight lang=J> 5 10$depolignac 3000 |
|||
1 127 149 251 331 337 373 509 599 701 |
|||
757 809 877 905 907 959 977 997 1019 1087 |
|||
1199 1207 1211 1243 1259 1271 1477 1529 1541 1549 |
|||
1589 1597 1619 1649 1657 1719 1759 1777 1783 1807 |
|||
1829 1859 1867 1927 1969 1973 1985 2171 2203 2213</syntaxhighlight> |
|||
=={{header|Raku}}== |
=={{header|Raku}}== |
||
<syntaxhighlight lang="raku" line>use List::Divvy; |
<syntaxhighlight lang="raku" line>use List::Divvy; |