Special neighbor primes: Difference between revisions

Content added Content deleted
(→‎J: generate the array of primes just once)
(→‎J: generate the triples directly, and by using the '2 f/\ y' SC)
Line 609: Line 609:


=={{header|J}}==
=={{header|J}}==
<syntaxhighlight lang="j"> (#~ 1 p: {:"1) (,. _1 + +/"1) 2 ,\ p: i. p:inv 100
<syntaxhighlight lang="j"> (#~ 1 p: {:"1) 2 (, , _1 + +)/\ p: i. p:inv 100
3 5 7
3 5 7
5 7 11
5 7 11