OFFSET
1,1
EXAMPLE
a(5) = 17 because 13 will not work (3 + 5 + 7 + 11 + 13 = 39) but 17 does work, with 3 + 5 + 7 + 11 + 17 = 43.
a(6) = 13 because it is the smallest prime that will produce the desired result: 5 + 7 + 11 + 17 + 13 = 53.
MATHEMATICA
f[s_List] := Block[{p = s[[-4]] + s[[-3]] + s[[-2]] + s[[-1]], q = 13}, While[ !PrimeQ[p + q] || MemberQ[s, q], q = NextPrime[q]]; Append[s, q]]; Nest[f, {3, 5, 7, 11}, 56]
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Nov 21 2012
STATUS
approved