Check if sum of first n primes is prime

From Rosetta Code
Check if sum of first n primes is prime is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.
Task
Check if sum of first n primes is prime, where n <= 20



Julia

<lang julia>using Primes </lang> The sum of the first 20 primes is <lang julia>julia> sum(prime(i) for i in 1:20) 639 </lang> So, with a bit of experimentation, we find that to duplicate the Ring result we need to sum up to the first 160 primes, which then gives us 20 prime results when we filter for a prime number as the sum: <lang julia>julia> filter(isprime, accumulate(+, primes(prime(160)))) 20-element Vector{Int64}:

    2
    5
   17
   41
  197
  281
 7699
 8893
22039
24133
25237
28697
32353
37561
38921
43201
44683
55837
61027
66463

</lang>


Ring

<lang ring> load "stdlib.ring" see "working..." + nl see "Sum of first primes is prime:" + nl n = 0 num = 0 primSum = 0

while true

   n++
   if isprime(n)
      primSum += n
      if isprime(primSum)
         num++
         see "n" + "(" + num + ") = " + primsum + " is prime" + nl
      ok
   ok
   if num = 20
      exit
   ok

end

see "done..." + nl </lang>

Output:
working...
Sum of first primes is prime:
n(1) = 2 is prime
n(2) = 5 is prime
n(3) = 17 is prime
n(4) = 41 is prime
n(5) = 197 is prime
n(6) = 281 is prime
n(7) = 7699 is prime
n(8) = 8893 is prime
n(9) = 22039 is prime
n(10) = 24133 is prime
n(11) = 25237 is prime
n(12) = 28697 is prime
n(13) = 32353 is prime
n(14) = 37561 is prime
n(15) = 38921 is prime
n(16) = 43201 is prime
n(17) = 44683 is prime
n(18) = 55837 is prime
n(19) = 61027 is prime
n(20) = 66463 is prime
done...