Repunit primes: Difference between revisions
Content added Content deleted
m (→{{header|RPL}}: highlighted syntax) |
(→J: add) |
||
Line 304: | Line 304: | ||
Base 35: [313 1297] |
Base 35: [313 1297] |
||
Base 36: [2] |
Base 36: [2] |
||
</pre> |
|||
=={{header|J}}== |
|||
Slow (runs several minutes). |
|||
<syntaxhighlight lang="j">repunitp=. 1 p: <:@^ % <:@[ |
|||
(2x + i. 15) (;/@[ ,. repunitp"0/ <@# ]) 2 + i. 999</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
┌──┬─────────────────────────────────────────┐ |
|||
│2 │2 3 5 7 13 17 19 31 61 89 107 127 521 607│ |
|||
├──┼─────────────────────────────────────────┤ |
|||
│3 │3 7 13 71 103 541 │ |
|||
├──┼─────────────────────────────────────────┤ |
|||
│4 │2 │ |
|||
├──┼─────────────────────────────────────────┤ |
|||
│5 │3 7 11 13 47 127 149 181 619 929 │ |
|||
├──┼─────────────────────────────────────────┤ |
|||
│6 │2 3 7 29 71 127 271 509 │ |
|||
├──┼─────────────────────────────────────────┤ |
|||
│7 │5 13 131 149 │ |
|||
├──┼─────────────────────────────────────────┤ |
|||
│8 │3 │ |
|||
├──┼─────────────────────────────────────────┤ |
|||
│9 │ │ |
|||
├──┼─────────────────────────────────────────┤ |
|||
│10│2 19 23 317 │ |
|||
├──┼─────────────────────────────────────────┤ |
|||
│11│17 19 73 139 907 │ |
|||
├──┼─────────────────────────────────────────┤ |
|||
│12│2 3 5 19 97 109 317 353 701 │ |
|||
├──┼─────────────────────────────────────────┤ |
|||
│13│5 7 137 283 883 991 │ |
|||
├──┼─────────────────────────────────────────┤ |
|||
│14│3 7 19 31 41 │ |
|||
├──┼─────────────────────────────────────────┤ |
|||
│15│3 43 73 487 │ |
|||
├──┼─────────────────────────────────────────┤ |
|||
│16│2 │ |
|||
└──┴─────────────────────────────────────────┘ |
|||
</pre> |
</pre> |
||