A352200 a(0)=0, a(1)=1; thereafter, a(n) is the smallest number m not yet in the sequence such that the binary expansions of m and a(n-1) have a 1 in the same position, but the positions of the 1's in the binary expansions of m and a(n-2) are disjoint, except that the second condition is ignored if it would imply that no choice for m were possible.
0, 1, 3, 2, 6, 4, 5, 9, 8, 10, 7, 17, 16, 18, 11, 12, 20, 19, 33, 32, 34, 14, 13, 49, 48, 21, 15, 40, 96, 64, 65, 23, 22, 24, 41, 35, 66, 68, 28, 25, 67, 38, 36, 29, 26, 98, 37, 129, 128, 130, 27, 44, 100, 80, 144, 131, 39, 52, 88, 72, 30, 50, 97, 69, 132, 136, 42, 51, 81, 76, 46, 146, 145, 45, 70, 82, 56, 137, 71, 54, 152, 73, 99, 134, 140, 57
Offset: 0
Examples
a(0)=0 and a(1)=1=1_2 are given. a(2) = 3 = 11_2 is disjoint from a(0) and intersects a(1). a(3) = 2 = 10_2 is disjoint from a(1) and intersects a(2). Now there is no choice for a(4) that meets both conditions, so we ignore the no-intersection-with-a(n-2) condition, and take a(4) = 6 = 110_2.
Links
- N. J. A. Sloane, Table of n, a(n) for n = 0..10000
- N. J. A. Sloane, Maple program
Crossrefs
Programs
-
Maple
See link.
Comments