OFFSET
1,2
COMMENTS
The sequence starts with a(1) = 1 and is always extended with the smallest integer not yet present that does not lead to a contradiction.
From Michael De Vlieger, Oct 12 2016 (Start):
The position of nonprimes in a(n) is {1, 3, 8, 15, 24, 34, 45, 58, 73, 89, 106, 125, ...}. (End)
LINKS
Jean-Marc Falcoz, Table of n, a(n) for n = 1..7162
EXAMPLE
As a(1) = 1, we take for a(2) the prime "2"; we then extend the sequence with a(3) which must be the smallest nonprime not yet present: this is "4"; we take for a(4), a(5), a(6) and a(7) the 4 smallest primes not yet present: they are 3, 5, 7 and 11; we then extend the sequence with the smallest nonprime available, which is a(8) = 6. Etc.
MATHEMATICA
c = Select[Range@ 120, ! PrimeQ@ # &]; Table[Prepend[Prime@ Most[Range @@ Take[FoldList[Plus, 0, Take[c, n]] + 1, -2]], c[[n]]], {n, 9}] // Flatten (* Michael De Vlieger, Oct 12 2016 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Eric Angelini and Jean-Marc Falcoz, Oct 11 2016
STATUS
approved