OFFSET
1,2
COMMENTS
Compute sums of k distinct sequential primes (no overlap). If the sums are prime add their indices to the sequence.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..1000
EXAMPLE
a(2)=3 because this k value is the index for the next 3 primes in sequence to be summed. k=1 is 2, k=2 is 3+5 and k=3 is 7+11+13=31. The sums at k=1 and k=3 are prime, while k=2 is composite.
PROG
(UBASIC)
10 K=1
20 A=nxtprm(A): B=B+A: C=C+1: if C<>K then 20: else 30
30 L=B/K
31 print K; B; : Q=prmdiv(B): if Q=B then print B; "-": stop: else 40
40 B=0: K=K+1: C=0: goto 20
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Enoch Haga, Oct 16 2007
STATUS
approved