OFFSET
1,1
COMMENTS
The sequence starts with a(1) = 2 and was always extended with the smallest integer not yet present that does not lead to a contradiction.
LINKS
Jean-Marc Falcoz, Table of n, a(n) for n = 1..7162
EXAMPLE
As a(1) = 2, we take for a(2) and a(3) the nonprimes "1" and "4"; we then extend the sequence with a(4) which must be the smallest prime not yet present: this is "3"; we take for a(5), a(6) and a(7) the 3 smallest nonprimes not yet present: they are 6, 8 and 9; we then extend the sequence with the smallest prime available, which is a(8) = 5. Etc.
MAPLE
p:= 0: q:= 0: res:= NULL:
for i from 1 to 20 do
p:= nextprime(p);
res:= res, p;
count:= 0;
while count < p do
q:= q+1;
if not isprime(q) then
res:= res, q;
count:= count+1;
fi
od
od:
res; # Robert Israel, Oct 19 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric Angelini and Jean-Marc Falcoz, Oct 11 2016
STATUS
approved