Task

Considering in order of length, n, all sequences of consecutive
primes, p, from 2 onwards, where p < 1000 and n>0, select those
sequences whose sum is prime, and for these display the length of the
sequence, the last item in the sequence, and the sum.




print (pad "index" 6) ++ " | " ++
      (pad "prime" 6) ++ " | " ++
      (pad "prime sum" 11)
print "------------------------------"
 
s: 0
idx: 0
loop 2..999 'n [
    if prime? n [
        idx: idx + 1
        s: s + n
        if prime? s ->
            print (pad to :string idx 6) ++ " | " ++
                  (pad to :string n 6) ++ " | " ++
                  (pad to :string s 11)
    ]
]