A288605 Position of first appearance of each integer in A088568 (number of 1's minus number of 2's in first n terms of A000002).
0, 1, 3, 12, 32, 93, 257, 378, 471, 798, 825, 858, 1127, 1398, 1497, 1524, 1533, 6352, 6969, 7176, 7269, 7566, 7971, 20338, 20371, 21982, 22009, 25638, 25665, 25692, 27969, 39184, 39211, 42398, 43129, 43150, 48637, 48730, 48757, 49014, 49041, 49068, 49095, 49864
Offset: 1
Keywords
Examples
A088568(12) = -2 is the first appearance of -2 in A088568, so 12 belongs to the sequence. A088568(32) = 2 is the first appearance of 2, so 32 belongs to the sequence.
Programs
-
Mathematica
Map[First, Values@ #] - 1 &@ PositionIndex@ Prepend[#, 0] &@ MapIndexed[3 First@ #2 - 2 #1 &, Accumulate@ Prepend[Nest[Flatten[Partition[#, 2] /. {{2, 2} -> {2, 2, 1, 1}, {2, 1} -> {2, 2, 1}, {1, 2} -> {2, 1, 1}, {1, 1} -> {2, 1}}] &, {2, 2}, 25], 1]] (* Michael De Vlieger, Jun 12 2017, after Birkas Gyorgy at A000002 *)
Comments