|
COMMENTS
|
This is the opposite parity sequence of A059459 and lexicographically least of this sequence.
It is currently not known whether both of these sequences are infinite.
I was able to calculate 40 terms; a(40) is a 3261-digit prime.
a(1) = 11; a(n+1) is obtained by writing a(n) in binary and trying to complement just one bit, starting with the least significant bit, until a new prime is reached. (Terms 2 and 3 are excluded values from the main sequence.)
Conjecture: Room 2 and Room 11 are unlinked, i.e., two separate mazes or branches/trees, as they are of opposite parities.
|
|
MATHEMATICA
|
maxBits = 2^14;
ClearAll[a];
a[1] = 3;
a[2] = 2;
a[3] = 11;
n = 4;
a[n_] :=
a[n] = If[PrimeQ[a[n - 1]],
bits = PadLeft[IntegerDigits[a[n - 1], 2], maxBits];
For[i = 1, i <= maxBits, i++, bits2 = bits;
bits2[[-i]] = 1 - bits[[-i]];
If[i == maxBits, Print["maxBits reached"]; Break[],
If[PrimeQ[an = FromDigits[bits2, 2]] &&
FreeQ[Table[a[k], {k, 1, n - 1}], an], Return[an]]]],
0]; Table[a[n], {n, 42}]
|