Check if sum of first n primes is prime: Difference between revisions
Check if sum of first n primes is prime (view source)
Revision as of 08:50, 23 July 2021
, 2 years ago→{{header|Julia}}
m (→{{header|Julia}}: list n) |
|||
Line 12:
639
</lang>
So, with a bit of experimentation, we find that to duplicate the Ring result we need to sum up to the first
gives us 20 prime results when we filter for a prime number as the sum:
<lang julia>julia> julia> filter(p -> isprime(p[2]), collect(enumerate(accumulate(+, primes(prime(
20-element Vector{Tuple{Int64, Int64}}:
(1, 2)
|