Successive prime differences: Difference between revisions
→{{header|J}}: align naming to task
(→{{header|J}}: simplify) |
(→{{header|J}}: align naming to task) |
||
Line 1,235:
primes_less_than=: i.&.:(p:inv)
assert 2 3 5 -: primes_less_than 7
NB. Insert minus `-/' into the length two infixes `\'.
NB. Passive `~' swaps the arguments producing the positive differences.
assert 8169 -: +/ 2 =
end_groups=:
┌─────┬─────┬───────────────────────────┐
├─────┼─────┼───────────────────────────┤
│2 │8169 │ 3 5 │
|