login
A277376
Each prime p is followed by p nonprimes.
1
2, 1, 4, 3, 6, 8, 9, 5, 10, 12, 14, 15, 16, 7, 18, 20, 21, 22, 24, 25, 26, 11, 27, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 13, 42, 44, 45, 46, 48, 49, 50, 51, 52, 54, 55, 56, 57, 17, 58, 60, 62, 63, 64, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 19, 81, 82, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 98, 99, 100
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
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
Sequence in context: A352112 A114862 A064579 * A105361 A370728 A125154
KEYWORD
nonn
AUTHOR
STATUS
approved