Jump to content

Triplet of three numbers: Difference between revisions

m (→‎{{header|Perl}}: note use of 'theory' module)
Line 1,027:
5738 5737 5741 5743</pre>
 
=={{header|Julia}}==
{{works with|jq}}
'''Works with gojq, the Go implementation of jq'''
 
<lang jq>def is_prime:
if . == 2 then true
else
2 < . and . % 2 == 1 and
(. as $in
| (($in + 1) | sqrt) as $m
| [false, 3] | until( .[0] or .[1] > $m; [$in % .[1] == 0, .[1] + 2])
| .[0]
| not)
end ;
 
range(3;6000) | select( all( .-1, .+3, .+5; is_prime))</lang>
{{out}}
<pre>
8
14
38
...
5648
5654
5738
</pre>
=={{header|Julia}}==
<lang julia>using Primes
2,485

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.