Prime numbers p for which the sum of primes less than or equal to p is prime: Difference between revisions
Prime numbers p for which the sum of primes less than or equal to p is prime (view source)
Revision as of 07:07, 25 March 2022
, 2 years ago→{{header|jq}}: simplify
(→{{header|jq}}: simplify) |
|||
Line 246:
=={{header|jq}}==
{{works with|jq}}
'''Works with gojq, the Go implementation of jq'''
This entry adopts the straightforward approach as used for example in the [[#awk|awk]] entry.
The jq implementation of this approach also turns out to be significantly faster than the jq implementation of the approach used in the [[#Wren|Wren]] entry.
See [[Erdős-primes#jq]] for a suitable definition of `is_prime` as
Line 261 ⟶ 263:
# Output: a stream of primes satisfying the condition
def results($n):
def task($n):
|