OFFSET
0,4
COMMENTS
Conjecture: There exist arbitrarily long chains of consecutive prime terms.
LINKS
Peter J. C. Moses, Table of n, a(n) for n = 0..9999
MAPLE
a:= proc(n) option remember; local k;
if n<2 then n
else for k from n-2 to 1 by -1
while not isprime(a(n-1) +a(k)) do od;
a(n-1) +a(`if`(k=0, n-2, k))
fi
end:
seq(a(n), n=0..100); # Alois P. Heinz, Mar 14 2013
MATHEMATICA
a216231[0]:=0;
a216231[1]:=1;
a216231[n_]:=a216231[n]=
Module[{k}, (k=NestWhile[#-1&, n-1, (#>1)&&!PrimeQ[a216231[n-1]+a216231[#]]&];
If[k==1, k=n-2]); a216231[n-1]+a216231[k]];
Table[a216231[n], {n, 0, 100}] (* Peter J. C. Moses, Mar 14 2013 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Mar 14 2013
STATUS
approved