OEIS A119435

A sequence by Leroy Quet (2006 0519), this page written by Michael Thomas De Vlieger, St. Louis, Missouri, 2022 0420.

Abstract.

We are inspired by the curious scatterplot of A119435 and the tantalizing bitmaps of A353035 and A353036 to write a few simple theorems about each.

Introduction.

Let A = A119435. Let U(n, j) > 0 be the j-th smallest number missing from A(1..n−1), hence, the set Un contains mA(1…n−1). Let u = U(n, 1) be the smallest missing number in A(1..n−1), that is, a local minimum of A.

We may define A as follows:

A(n) = m = U(n, A030101(n)),

[Formula 1]

where A030101(n) is the bit-reversal of n. Example: A030101(12) = 3 since 12 expanded in binary is “1100”; reversing this gives us binary “0011”, i.e., 2¹ + 2⁰ = 2+1 = 3.

The sequence begins as follows (See Codes 1, 2, and 3, Figures 1 and 2):

1, 2, 5, 3, 9, 7, 13, 4, 17, 12, 23, 10, 22, 18, 29, 6, 33, 24, 43, 16, 40, 31, 51, 14, 41, 30, 53, 25, 49, 38, 61, 8, 65, 45, 83, 32, 76, 58, 95, 21, 74, 55, 94, 42, 87, 68, 107, 19, 78, 56, 100, 39, 91, 70, 113, 34, 89, 66, 112, 52, 104, 81, 125, 11, 129, 86, 163, 60, 148, 114, 183, 44, 142, 103, 178, 77, 162, 127, 199, 28, 143, 101, 181, 72, 165, 126, 203, 57, 157, 118, 197, 92, 180, 140, 219, 26, 151, 106, 193, 73, 174, 133, 216, 54, 168, 122, 211, 96, 192, 149, 233, 46, 169, 120, 214, 88, 195, 147, 237, 69, ...

A comment at A119435 claims the sequence is a permutation of the natural numbers. Sloane added a proof 20 April 2022 based on the logic of Theorem 2 that shows the sequence is infinite. Given this proof and the fact A is a lexically-eariest sequence (LES), we show that the sequence indeed is a permutation.

Axioms.

The first 2 axioms come about since A is a LES:

Lexical Axiom: A(n) = m : m ∈ ℕ ∧ mA(1…n−1).
Earliest Axiom: If M > m and M also satisfies the other axioms, A(n) = m.
Selection Axiom: A(n) = U(n, A030301(n)).
Unused Axiom: A(n) = mUn \ {m}.

Consider a characteristic of all lexically earliest sequences. That is, the range of A(n) = m is divided into 3 intervals:
1. The saturated zone m < u. Here, mA(1…n−1), hence there is no need to consider such m.
2. The open zone m > r. Here, mA(1…n−1) by definition of record r. Therefore, iff we arrived at m through a greedy algorithm, i.e., satisfying all the other axioms and approaching from below, then A(n) = m.
3. The mixed zone um < r. If we arrived at m through a greedy algorithm, we have to test whether mA(1…n−1). If false, A(n) = m. We may include r in this zone, though we know if m = r, then mA(1…n−1) and is banned from a second entry into A.

Theorem 1: In this sequence, both axioms entailed by lexically earliest approach are embodied in the Selection Axiom.
Proof 1: Suppose that U(n, A030301(n))) → A(n) = A(i) = m, i < n. Then A(i) =mUn \ {m}, a contradiction. Also, suppose that U(n, A030301(n))) → M > m. This would entail that it were possible to find both M and m via U(n, A030301(n))), or that A030301(n) might have 2 values, both of which is clearly impossible. ∎

Consequently, Formula 1 is an adequate definition of the sequence.

Maxima and minima in A119435.

Theorem 2: A(2k) is a local minimum.
Proof 2: Observe that A030101(2k) = 1. 2k expressed in binary is 1 followed by zeros. When we reverse this number, the leading zeros are trivial and we read the number 1 in the 2⁰ place. Therefore we set A(n) = U(2k, 1), which by definition is the smallest missing number mA(1…n−1). ∎

Corollary 2.1: Since A(2k) = u, we may designate u instead as uk. Hence,un = u⌊log₂ n = uk for 2kn < 2(k+1).

We define A353035(n) = A(2n), the set of local minima in A. (See Code 5 and Figure 3.) Rémy Sigrist has expanded this to 45 terms:

1, 2, 3, 4, 6, 8, 11, 15, 20, 27, 36, 48, 64, 85, 116, 153, 208, 273, 366, 493, 649, 888, 1161, 1579, 2092, 2784, 3783, 4946, 6772, 8875, 11977, 16065, 21193, 28979, 37823, 51633, 68117, 91045, 123377, 161622, 221441, 289493, 392259, 523328, 692771, 945393, ...

We define A353036 as the set of records r in A, and A353037 the indices of records in A.
Therefore, A(A353037(n)) = A353036(n) is the n-th record in A.

The set of records A353036 begins as follows (See Code 4 and Figure 4):

1, 2, 5, 9, 13, 17, 23, 29, 33, 43, 51, 53, 61, 65, 83, 95, 107, 113, 125, 129, 163, 183, 199, 203, 219, 233, 237, 253, 257, 323, 359, 383, 407, 419, 443, 449, 473, 485, 509, 513, 643, 711, 751, 783, 791, 823, 851, 859, 891, 913, 921, 953, 981, 989, 1021, 1025, ...

The sequence of their indices A353037 begins as follows (See Code 4 and Figure 5):

1, 2, 3, 5, 7, 9, 11, 15, 17, 19, 23, 27, 31, 33, 35, 39, 47, 55, 63, 65, 67, 71, 79, 87, 95, 111, 119, 127, 129, 131, 135, 143, 159, 175, 191, 207, 223, 239, 255, 257, 259, 263, 271, 287, 303, 319, 351, 367, 383, 415, 431, 447, 479, 495, 511, 513, 515, 519, 527, ...

The bitmaps seen in Figures 4 and 5, and their interpretation in Table 1 inspires us to attempt to prove a few things about the records transform of A119435.

Theorem 3: 2k±1 ∈ A353037 for k > 0.
Proof 3: m = 2k – 1 is a repunit, the largest k-bit number, thus A030101(m) = m. Let r = max(A(1…m−1). Since the function U(n, A030101(n)) appends a missing number to A at each iteration, any previous record r < U(m, m). Therefore, U(m, m) is the largest missing number and sets a new record in A. ∎
M = 2k + 1 is the second-smallest k-bit number with 1 in the least and most significant places and all the rest of the bits are 0, hence A030101(M) = M. The previous record r = U(m, m), since A(2k) = U(2k,1) is a local minimum. Since M > m, U(M, M) > U(m, m). ∎

Corollary 3.1: A(2k + 1) = A(2k − 1) + 4, i.e., U(M, M) = U(m, m) + 4, since M = 2k+1 = (2k − 1)+2 = m + 2, and 2 additional missing numbers entered A since A(2k − 2).

Theorem 4: A(2k − 1) + 3 = 2(k+1)A(2k + 1) − 1 = 2(k+1) : k > 1. This is tantamount to proving A(2k − 1) = 2(k+1) – 3 and A(2k + 1) = 2(k+1) + 1.
Through mechanics of A119435, the sequence begins as follows, highlighting A(2k):

1, 2, 5, 3, 9, 7, 13, 4, 17, 12, 23, 10, …

Proof 4: We note that A(2k + 1) = A(2k − 1) + 4 per Corollary 3.1. A(2²−1) = A(3) = 5, since U(3) = {3, …}, and since A030101(3) = 3, knowing U(3, 3) is a record, we have A(3) = U(3, 3) = 5. We have proved A(2k±1) set records in A by Theorem 3. Therefore it merely remains to show that A(2(k+1)±1) = A(2k±1) + 2(k+1). Indeed, via A(n) = m Un\ {m}, we lose 1 element as n increments. But then n has increased as well each time. Hence we see that indeed, A(2k − 1) + 3 = 2(k+1)A(2k + 1) − 1 = 2(k+1) : k > 1. ∎

Corollary 4.1: (2(k+1) – 1) ± 2 ∈ A353036.

The nature of Un.

Let U(n, R) = r + 1, where r is the latest record in A. In other words, Rn is that index in the list Un of mA(1…n–1), that is, U(n, Rn), where U(n, Rn+ 1) − U(n, Rn) = 1, generally, U(n, Rn+ j + 1) − U(n, Rn+ j) = 1 for j ≥ 0.

The sequence R = {Rn} begins as follows (See Code 6.):

1, 1, 3, 2, 5, 4, 7, 6, 9, 8, 13, 12, 11, 10, 15, 14, 17, 16, 25, 24, 23, 22, 29, 28, 27, 26, 27, 26, 25, 24, 31, 30, 33, 32, 49, 48, 47, 46, 57, 56, 55, 54, 53, 52, 51, 50, 61, 60, 59, 58, 57, 56, 55, 54, 59, 58, 57, 56, 55, 54, 53, 52, 63, 62, 65, 64, 97, 96, 95, 94, 113, 112, 111, 110, 109, 108, 107, 106, 121, 120, 119, 118, 117, 116, 115, 114, 117, 116, 115, 114, 113, 112, 111, 110, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 123, 122, 121, 120, 119, 118, 117, 116, 119, 118, ...

Figure 7 plots R in green against A in black and shows the most recent record r in red.

Theorem 5: U(n, Rn+ j) = r + j + 1. (See Figure 7).
Proof 5: By definition of record r = max(A(1…n−1)), it is clear that r + 1 = mA(1…n–1), and since r + j +1 > r + 1 for j ≥ 0, we see that we can describe the open zone of mA(1…n−1) through induction on j. ∎

Corollary 5.1: |Un | = ℵ₀. This, since Un = ℕ \ A(1…n−1), where | ℕ | = ℵ₀ and |A(1…n−1)| = n−1.

Corollary 5.2: We can partition Un into 2 zones, a finite Wn and an infinite Vn, using Rn.

  1. The open zone V(n, j) = U(n, Rn+ j − 1) : j ≥ 1 (resetting j from Theorem 5).
    Vn
    ∋ {m > r : mA(1…n−1) r = max(A(1…n−1))}.
    V(n, j+1) − V(n, j) = 1 : j > 1, hence the open zone Vn has first difference D = 1. Therefore, whereupon A(n) = m > r, Vn \ {r+1…m}. Since Vn = { (r+1)…∞ }, | Vn | = ℵ₀.
  2. The mixed zone W(n, j) = U(n, j) : 1 ≤ j < Rn.
    Wn
    ∋ {mA(1…n−1) : um < r}, thus has finite cardinality (Rn−1).
    The mixed zone has first differences D ≥ 1.

Corollary 5.3: R(n) decreases monotonically as n increases, unless A(n) = r' > r. If A(n) = r' > r, then R(n+d) = Rn+ (r'r). Figure 7 shows how Rn (in green) decrements as n increments, unless we have a new record, moving the red line of r up; green also moves up. And it is clear that the blue line rRn = (n − 1), since 1 term m enters A as n increases, while Un loses the term m.

Corollary 5.4: Rn = r n + 1, thus, sequence R + ℕ − 1 = A.

Corollary 5.5: A030301(n) ≥ Rn A(n) = r' > r. This follows from the definition of record and the definition of Rn.

Corollary 5.6: unr − Rn.

Conjecture 6: We expand on Theorem 3, tantalized by Figure 6, to suggest the following regarding S = A353037:

2(k+1) − (A043569(A152948(n) − 1 … A152948(n+1) − 2) ∈ S : k ≥ 1.

This latter conjecture generates the following numbers that are known to be in A353037:

  3
  5    7
  9   11   15
 17   19   23   31
 33   35   39   47   63
 65   67   71   79   95  127
129  131  135  143  159  191  255
257  259  263  271  287  319  383  511
513  515  519  527  543  575  639  767  1023
...

A proof remains to be written, but likely has to do with the nature of Un, the values of local minima A(2k) and the sandwiching local maxima A(2k±1).

Conjecture 7: Let irregular triangle T(k, i) = A353037 partitioned by k = ⌊log₂ m⌋ : m ∈ A353037. Recall that A353037 is a list of indices of records in A. Theorem 3 proved 2k±1 ∈ A353037 for k > 0, therefore we begin row k with 2k+1 and end it with 2(k+1)−1.

The triangle begins:

0:    1
1:    2    3
2:    5    7
3:    9   11   15
4:   17   19   23   27   31
5:   33   35   39   47   55   63
6:   65   67   71   79   87   95  111  119  127
7:  129  131  135  143  159  175  191  207  223  239  255
8:  257  259  263  271  287  303  319  351  367  383  415  431  447  479  495  511

Row lengths of this triangle are as follows:

1, 2, 2, 3, 5, 6, 9, 11, 16, 20, 29, 37, 54, 70, 103, 135, 200, 264, 393, ...

We take first differences δ so as to note a pattern, prepending the row with the first term:

0:    1
1:    2   1
2:    5   2
3:    9   2   4
4:   17   2   4   4   4
5:   33   2   4   8   8   8
6:   65   2   4   8   8   8  16   8   8
7:  129   2   4   8  16  16  16  16  16  16  16
8:  257   2   4   8  16  16  16  32  16  16  32  16  16  32  16  16

So as to condense this table, we write only log₂ δ and drop the first column:

 1: 0
 2: 1
 3: 12
 4: 1222
 5: 12333
 6: 12333433
 7: 1234444444
 8: 123444544544544
 9: 1234555555555555555
10: 1234555655655655655655655655
11: 12345666666666666666666666666666666
12: 12345666766766766766766766766766766766766766766766766

Hence it seems that we can write some method of generating A353037.

We can match 1360 terms of A353037 resulting from A(1…2¹⁹) using the following algorithm. The algorithm derives from observations of the tables immediately above and Figure 5.

1.) For k = 0, row k = {1}, and for k = 1, we prepend 2 to the algorithmically-generated row.
2.) Do loop using iterator k = 1.
   a.) Set m = 2k, set counter c and exponent j to −1. Set maximum exponent e = ⌈k/2⌉.
   b.) While log₂ m < k + 1, sow m, increment c, and if j < e, increment j. Set m = 2(j + x).
   Note: x = [IsInteger(k/2+3) ∧ c ≥ k/2+3 ∧ c mod 3 ≡ (k/2) mod 3], Iverson brackets.
3. Reap the sown values of m to comprise row k.

Setting k = 18, we obtain a dataset T(1..1360) = A353037(1..1360), verified using T(n) XOR A353037(n). See Code 9.

A proof remains to be written that verifies this conjectural algorithm approach.

If the approach confirms indices of records in A119435, then the extended list of row lengths is as follows:

1, 2, 2, 3, 5, 6, 9, 11, 16, 20, 29, 37, 54, 70, 103, 135, 200, 264, 393, 521, 778, 1034, 1547, 2059, 3084, 4108, 6157, 8205, 12302, 16398, 24591, 32783, 49168, 65552, 98321, 131089, 196626, 262162, 393235, 524307, 786452, ...

This sequence does not appear in OEIS (and probably shouldn’t).

Conjecture 8: We can compute records r (in A353036) from their indices n (in A353037). It seems to follow that we might be able to generate records from their indices because of the axioms. Indeed, the sequence A119435 might either be seen as the recursive mapping of U(n, A030101(n)), or it may be seen as A(n) → U \ {m} ↦ A030101 : m ∈ A030101.

We base this conjecture on the bitmaps of A353036 and A353037, specifically, when they are overlaid as in Figure 6. The last-mentioned figure gives us the impression that the bits in r are a function of the bits in n, or, rather, that the algorithm that generates n (Code 9) could also produce r.

(This segment is in progress; we have found means of manipulating the bits in certain n to furnish r.)

Conclusion.

Therefore we may state the following facts:

  1. A119435(2k) = U(n, 1), ∴ A119435(2k) is a local minimum of A,
  2. 2k ± 1 ∈ A353037 : k > 0,
  3. A119435(2k + 1) = A119435(2k − 1) + 4,
  4. A119435(2k − 1) = 2(k+1) − 3 ∧ A119435(2k + 1) = 2(k+1) + 1 ∴ (2(k+1) − 1) ± 2 ∈ A353036.

We restate the above in plain English so as to be clear.

  1. A119435(2k) is the smallest missing number u, thus, A119435(2k) is a local minimum of A and appears in A353035.
  2. A119435(2k ± 1) with k > 0 are records and thus appear in A353037,
  3. A119435(2k + 1) = A119435(2k − 1) + 4,
  4. A119435(2k − 1) = 2(k+1) − 3 and A119435(2k + 1) = 2(k+1) + 1, therefore (2(k+1) − 1) ± 2 are records in A119435 and appear in A353036.

Furthermore it appears we have a means via Code 9 of generating A353037 independent of taking a records transform of A.

Some open questions:

  1. Is there a way to ascertain A119435(2k) = u, that is, the terms in A353035 without generating A119435? We are tantalized by being able to compute A119435(2k ± 1) and Rn given A353036 and A353037. Figure 3 doesn’t seem to help.
  2. Can we use Conjecture 6 and the patterns seen in Figures 5 through 8 to compute A(n) in a manner other than recursively mapping U(n, A030101(n))?
  3. If we have a means of computing A353036 in addition to A353037 using Conjecture 6 or the patterns mentioned above, is such sufficient to compute A?

Figure 6 seems to suggest that, given A353037(n), we ought to be able to generate A353036(n). If this is possible, then we would be able to generate the records transform of A without generating A itself. Furthermore, if we have both A353036 and A353037, we can generate R.

This concludes our examination.

Acknowledgement.

I would like to acknowledge Dr. Neil J. A. Sloane for mentioning A119435 on 17 April 2022 in a request to extend the b-file.

Appendix.

Table 1: Binary expansion of A353036(n) and A353037(n) for n = 1..56. Let = 1+⌊log₂ m⌋ where m is either A353036(n) or A353037(n). Then 2−1 is the largest number with the same number of bits as m. We define N = 2m − 1. (See Code 7.)

 n        A353036(i)    2^L-1   N      A353037(i)    2^L-1  N
-------------------------------------------------------------
 1     1            1     1     0    1           1     1    0
 2     2           1.     3     1    2          1.     3    1
 3     5          1.1     7     2    3          11     3    0
 4     9         1..1    15     6    5         1.1     7    2
 5    13         11.1    15     2    7         111     7    0
 6    17        1...1    31    14    9        1..1    15    6
 7    23        1.111    31     8   11        1.11    15    4
 8    29        111.1    31     2   15        1111    15    0
 9    33       1....1    63    30   17       1...1    31   14
10    43       1.1.11    63    20   19       1..11    31   12
11    51       11..11    63    12   23       1.111    31    8
12    53       11.1.1    63    10   27       11.11    31    4
13    61       1111.1    63     2   31       11111    31    0
14    65      1.....1   127    62   33      1....1    63   30
15    83      1.1..11   127    44   35      1...11    63   28
16    95      1.11111   127    32   39      1..111    63   24
17   107      11.1.11   127    20   47      1.1111    63   16
18   113      111...1   127    14   55      11.111    63    8
19   125      11111.1   127     2   63      111111    63    0
20   129     1......1   255   126   65     1.....1   127   62
21   163     1.1...11   255    92   67     1....11   127   60
22   183     1.11.111   255    72   71     1...111   127   56
23   199     11...111   255    56   79     1..1111   127   48
24   203     11..1.11   255    52   87     1.1.111   127   40
25   219     11.11.11   255    36   95     1.11111   127   32
26   233     111.1..1   255    22  111     11.1111   127   16
27   237     111.11.1   255    18  119     111.111   127    8
28   253     111111.1   255     2  127     1111111   127    0
29   257    1.......1   511   254  129    1......1   255  126
30   323    1.1....11   511   188  131    1.....11   255  124
31   359    1.11..111   511   152  135    1....111   255  120
32   383    1.1111111   511   128  143    1...1111   255  112
33   407    11..1.111   511   104  159    1..11111   255   96
34   419    11.1...11   511    92  175    1.1.1111   255   80
35   443    11.111.11   511    68  191    1.111111   255   64
36   449    111.....1   511    62  207    11..1111   255   48
37   473    111.11..1   511    38  223    11.11111   255   32
38   485    1111..1.1   511    26  239    111.1111   255   16
39   509    1111111.1   511     2  255    11111111   255    0
40   513   1........1  1023   510  257   1.......1   511  254
41   643   1.1.....11  1023   380  259   1......11   511  252
42   711   1.11...111  1023   312  263   1.....111   511  248
43   751   1.111.1111  1023   272  271   1....1111   511  240
44   783   11....1111  1023   240  287   1...11111   511  224
45   791   11...1.111  1023   232  303   1..1.1111   511  208
46   823   11..11.111  1023   200  319   1..111111   511  192
47   851   11.1.1..11  1023   172  351   1.1.11111   511  160
48   859   11.1.11.11  1023   164  367   1.11.1111   511  144
49   891   11.1111.11  1023   132  383   1.1111111   511  128
50   913   111..1...1  1023   110  415   11..11111   511   96
51   921   111..11..1  1023   102  431   11.1.1111   511   80
52   953   111.111..1  1023    70  447   11.111111   511   64
53   981   1111.1.1.1  1023    42  479   111.11111   511   32
54   989   1111.111.1  1023    34  495   1111.1111   511   16
55  1021   11111111.1  1023     2  511   111111111   511    0
56  1025  1.........1  2047  1022  513  1........1  1023  510

Figure 1: Log-log scatterplot of A(n), n = 1..2¹², showing odd n in blue and even n in red.

Figure 2: Bitmap of A(n), n = 1..2¹⁰, 24× vertical exaggeration. Here we show 1 in black and 0 in white, with the least-significant bit at bottom.

Figure 3: Bitmap of A353035(n), n = 1..45, 4× exaggeration. Here we show 1 in black and 0 in white, with the least-significant bit at bottom.

Figure 4: Bitmap of A353036(n), n = 1..967, 12× vertical exaggeration. Here we show 1 in black and 0 in white, with the least-significant bit at bottom. (See Code 8.)

Figure 5: Bitmap of A353037(n), n = 1..967, 12× vertical exaggeration. Here we show 1 in black and 0 in white, with the least-significant bit at bottom. (Similar to Code 8.)

Figure 6: Bitmap of A353036(n) with 1s in red overlaid on A353037(n) with 1s in blue, n = 1..142, 4× exaggeration. We add the RGB values of the pixels such that where the two sequences agree, we have magenta.

Figure 7: Log-log scatterplot of A(n), n = 1..2¹⁰, overlaying the latest record r in red, R in green, and rR in blue.

References:

Code 1: Syntactically simple list method:

a119435 = Block[{a = {1}, nn = 2^14},
  Monitor[Do[
    AppendTo[a, Complement[Range[i + 2 nn], a][[IntegerReverse[i, 2]]]],
    {i, 2, nn}], i]; a];

Code 2: Gap incrementation method (slow):

Block[{nn = 2^12, a, c, j, k, r, m, u}, c[_] = 0; u = 1;
  Monitor[Do[r = IntegerReverse[i, 2]; j = 1; k = u;
    While[Nand[c[k] == 0, j == r], j += Boole[c[k] == 0]; k++];
    Set[{a[i], c[k]}, {k, i}];
    If[k == u, While[c[u] > 0, u++]], {i, nn}], i]; Array[a, nn]]

Code 3: Literal U(n, j) approach:

Block[{nn = 2^16, a, c, j, k, r, m, u, w}, c[_] = 0; u = 1;
  w = Range[16];
  Monitor[Do[
    If[IntegerQ[#],
      Set[w, DeleteCases[
        Union[w, Range[Max[w], 2^(# + 2)]], _?(# < u &)]]] &@ Log2[i];
    m = IntegerReverse[i, 2]; j = 1; k = w[[m]];
    Set[{a[i], c[k]}, {k, i}];
    Set[w, DeleteCases[w, k]];
    If[k == u, While[c[u] > 0, u++]], {i, nn}], i]; Array[a, nn]]

Code 4: Records transform:

Set[{a353036, a353037},
  Block[{r = 0, s = a119435},
    Transpose@ Reap[Do[If[# > r, r = #; Sow[{r, i}]] &@ s[[i]],
      {i, Length@ s}]][[-1, -1]] ] ];

Code 5: Local minima transform:

Set[{a353035, a353035i},
Block[{u = 1, c, s = a119435}, c[_] = 0;
  Transpose@ Reap[Do[Set[c[s[[i]]], i];
    If[s[[i]] == u, Sow[{u, i}]; While[c[u] > 0, u++]],
    {i, Length@ s}]][[-1, -1]]]];

Code 6: Calculate R from a dataset a119435.

a353036r = Block[{c, u, r, s = a119435[[1 ;; 2^10]]},
  c[_] = 0; u = r = 0;
  Reap[Do[c[s[[i]]] = i;
    Which[# > r, r = #, # == u, While[c[u] > 0, u++]] &@ s[[i]];
    Sow[Count[Range[u, r - 1], _?(c[#] == 0 &)]], {i, Length@ s}]][[-1, -1]]];

Code 7: Produce Table 1:

Table[{#1, #2, StringReplace[IntegerString[#2, 2], "0" -> "." ], #4 - 1, Total[2^(#5)], #6,
  StringReplace[IntegerString[#6, 2], "0" -> "." ], #8 - 1, Total[2^(#9)]} & @@
  {#1, #2, #3, 2^Length[#3], Position[#3, 0][[All, 1]] - 1, #4, #5,
  2^Length[#5], Position[#5, 0][[All, 1]] - 1} & @@
  {n, a353036[[n]], Reverse@ IntegerDigits[a353036[[n]], 2], a353037[[n]],
    Reverse@ IntegerDigits[a353037[[n]], 2]}, {n, 56}] // TableForm

Code 8: Produce Figure 4 (for Figure 5, substitute “a353037” for “a353036”:

Block[{s = a353036, w},
  w = Function[{t, m}, Map[PadLeft[#, m] &, t]] @@ {#, Max[Length /@ #]} &@
    Array[IntegerDigits[s[[#]], 2] &, Length[s]];
  ImageReflect@ ImageRotate@
    ImageResize[ColorNegate@ Image@ w, {Scaled[12], All}, Resampling -> "Nearest"] ]

Code 9: Generate A353037 via Conjecture 7:

Block[{r, nn = 18, c, j, k, m},
  Monitor[Do[c = j = -1; k = 2^i; m = Ceiling[i/2];
  r[i] = Rest@ Reap[
    While[Log2[k] < i + 1, Sow[k]; c++; If[j < m, j++]; k += 2^(j +
      Boole[And[IntegerQ[#], c >= #, Mod[c, 3] == Mod[#, 3]]] &[i/2 + 3])]][[-1, -1]],
  {i, nn}], i];
  {1, 2}~Join~Flatten@ Array[r, nn]]

Concerns sequences:

A030101: Bit-reversal of n.
A043569: Numbers m whose binary expansion has exactly 2 runs.
A119435: A(n) = (binary reversal of n)-th integer among those positive integers not occurring earlier in the sequence.
A152948: A152948(n) = (n² − 3n + 6)/2.
A353035: Local minima in A; A353035(n) = A(2n).
A353036: Maxima in A.
A353037: Positions of maxima in A.
A353069: R(n) = index of (r+1) in Un.

Document Revision Record.

2022 0420 1545 Draft.
2022 0420 2115 Publication.
2022 0421 2200 Conjecture 7.
2022 0422 2215 Conjecture 8.