Strange unique prime triplets: Difference between revisions

Content added Content deleted
(→‎J: add a first draft)
(→‎J: fully tacit)
Line 1,448: Line 1,448:


=={{header|J}}==
=={{header|J}}==
<syntaxhighlight lang="j"> cb=. {{;@:(({. <@,. u@}.)\.)}}
<syntaxhighlight lang="j"> cb=. ;@:({. <@,. @\.)}.
triplets=. (#~ 1 p: +/"1)@({~ {.\.cb cb@i.@#)@(i.&.(p:inv))
comb3=. ]cb cb@i.
triplets=. (#~ 1 p: +/"1)@({~ comb3@#)@(i.&.(p:inv))


triplets 30
triplets 30
Line 1,495: Line 1,496:
19 23 29
19 23 29


# triplets 1000
#@triplets 1000
241580</syntaxhighlight>
241580</syntaxhighlight>