OFFSET
1,1
COMMENTS
Every 2k-th term is the smallest number which has not been included earlier.
EXAMPLE
a(1) = 2, a(2)=1, 1+4 = 5 which is prime; a(3) = 4, 4+3+6 = 13 which is prime; a(4) = 3, 3+6+5+9 = 23 which is prime; etc.
MATHEMATICA
a = {2, 1, 4}; f[n_] := Block[{k = 1, b = Take[a, {n, 2n - 3}]}, While[ Position[a, k] != {}, k++ ]; b = Append[b, k]; a = Append[a, k]; While[ Position[a, k] != {} || !PrimeQ[Plus @@ b + k], k++ ]; a = Append[a, k]]; Do[ f[n], {n, 3, 40}]; a
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Aug 11 2002
STATUS
approved