Strange unique prime triplets: Difference between revisions

→‎J: pick combinations directly
(→‎J: fully tacit)
(→‎J: pick combinations directly)
Line 339:
 
=={{header|Arturo}}==
 
<syntaxhighlight lang="arturo">findTriplets: function [upTo][
results: []
Line 936 ⟶ 935:
74588542
</pre>
 
=={{header|Factor}}==
<syntaxhighlight lang="factor">USING: formatting io kernel math math.combinatorics math.primes
Line 1,202:
 
=={{header|Fōrmulæ}}==
 
{{FormulaeEntry|page=https://formulae.org/?script=examples/Strange_unique_prime_triplets}}
 
Line 1,448 ⟶ 1,447:
 
=={{header|J}}==
<syntaxhighlight lang="j"> cb=. ;@:({. <@,. @\.)}.
comb3=. ]cb cb@i.
triplets=. (#~ 1 p: +/"1)@({~ comb3@#)@(i.&.(p:inv)"0)</syntaxhighlight>
{{out}}
 
<pre> triplets 30
3 5 11
3 5 23
Line 1,496 ⟶ 1,495:
19 23 29
 
#@triplets 30 1000
42 241580</syntaxhighlightpre>
 
=={{header|Java}}==
Line 1,678 ⟶ 1,677:
Stretch goal: 241580
</pre>
 
=={{header|Julia}}==
<syntaxhighlight lang="julia">using Primes
Line 2,298:
 
=={{header|Quackery}}==
 
<code>isprime</code> is defined at [[Primality by trial division#Quackery]].
 
559

edits