OFFSET
1,1
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..10000
EXAMPLE
2+3+2=7 is prime so a(1)=2.
3+5+3=11 is prime so a(2)=3.
5+7+3=15 is composite, and 5+7+5=17 is prime so a(3)=5.
MATHEMATICA
spn[n_]:=Module[{p=2}, While[!PrimeQ[n+p], p=NextPrime[p]]; p]; spn/@ (Total/@ Partition[Prime[Range[100]], 2, 1]) (* Harvey P. Dale, Mar 14 2022 *)
PROG
(PFGW & SCRIPT)
SCRIPT
DIM k
DIM n, 0
OPENFILEOUT myf, a(n).txt
LABEL loop1
SET n, n+1
IF n>10000 THEN END
SET k, 0
LABEL loop2
SET k, k+1
PRP p(n)+p(n+1)+p(k)
IF ISPRP then GOTO a
GOTO loop2
LABEL a
WRITE myf, t
GOTO loop1
(PARI) a(n) = t=prime(n)+prime(n+1); k=1; while(!isprime(t+q=prime(k)), k++); q \\ Colin Barker, Aug 25 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Aug 25 2014
STATUS
approved