OFFSET
1,1
COMMENTS
Least prime not already present, formed from the previous prime by first flipping or inverting a single binary bit and if no such prime exists, then two contiguous bits, then three, etc., and if no such prime exists then by inserting increasing binary bits starting with "0", "1", "00", "01", "10", "11", etc. resulting in the least prime so created. Leading zeros are forbidden.
Inspired by A059459.
EXAMPLE
a(1) = 2 = 10_2, by definition, there are no single binary digit primes and this is the least 2-bit prime;
a(2) = 3 = 11_2, the least significant bit was "flipped"; all 2-bit primes are now present;
a(3) = 5 = 101_2, since the next prime is formed by inserting a 0;
a(4) = 7 = 111_2, since it is obtained by "flipping" the twos bit; all 3-bit primes are now present;
a(5) = 11 = 1011_2, since it is the least prime formed by inserting a 0;
a(6) = 13 = 1101_2, since it is the least prime formed by flipping two contiguous bits; all 4-bit primes are now present;
a(7) = 29 = 11101_2, since it is the least prime formed by inserting a 1; no prime is generated by the insertion of a 0, i.e.; from 1101 (13_10) -> 10101 (21_10) or 11001 (25_10);
a(8) = 31 = 11111_2, since it is the least prime formed by flipping the twos bit;
a(9) = 23 = 10111_2, since it is the least prime formed by flipping one bits;
a(10) = 19 = 10011_2; flip 1 digit;
a(11) = 17 = 10001_2; flip 1 digit, all 5-bit primes are now present;
a(12) = 37 = 100101_2; insert the single digit 1, inserting the single digit 0 yields the composite 100001_2 = 33.
a(13) = 53 = 110101_2; flip a single digit; etc.
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Robert G. Wilson v, Sep 11 2017
STATUS
approved