OFFSET
1,3
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
There are 5 prime among the first 9 terms of the sequence. So a(10) = a(8) + a(9) + 5 = 40 + 67 + 5 = 112.
MAPLE
a[1]:=1: a[2]:=1: for n from 3 to 45 do ct:=0: a[n]:=a[n-1]+a[n-2]+ct: for j from 3 to n-1 do if isprime(a[j])=true then a[n]:=a[n]+1 else fi od: od: seq(a[n], n=1..45); # Emeric Deutsch, May 25 2007
MATHEMATICA
nxt[{a_, b_, p_}]:={b, a+b+p, If[PrimeQ[a+b+p], p+1, p]}; Transpose[ NestList[ nxt, {0, 1, 0}, 40]][[2]] (* Harvey P. Dale, May 01 2014 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, May 08 2007
EXTENSIONS
More terms from Emeric Deutsch, May 25 2007
STATUS
approved