This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A354774 #37 Nov 29 2023 13:08:13 %S A354774 1,3,4,5,6,7,9,10,4,11,13,14,6,15,17,18,19,20,21,22,5,23,25,26,27,28, %T A354774 29,30,7,31,33,34,35,36,37,38,39,40,41,42,43,44,45,46,23,47,49,50,51, %U A354774 52,53,54,55,56,57,58,59,60,61,62,31,63,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86 %N A354774 For terms of A354169 that are the sum of two distinct powers of 2, the exponent of the larger power of 2. %C A354774 Taking first differences, then applying the RUNS transform gives [1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 13, 1, 1, 1, 13, 1, 1, 1, 29, 1, 1, 1, 29, 1, 1, 1, 61, 1, 1, 1, 61, 1, 1, 1, 125, 1, 1, 1, 125, 1, 1, 1, 253, 1, 1, 1, 253, 1, 1, 1, 509, ...]. %C A354774 If the initial 4 is changed to a 1, this has an obvious regular structure, which could then be analyzed to give a conjectured generating function, just as was done for A354767. See link below. %C A354774 A more precise conjecture is given in the Formula section. %H A354774 Rémy Sigrist, <a href="/A354774/b354774.txt">Table of n, a(n) for n = 1..10000</a> %H A354774 Michael De Vlieger, Thomas Scheuerle, Rémy Sigrist, N. J. A. Sloane, and Walter Trump, <a href="http://arxiv.org/abs/2209.04108">The Binary Two-Up Sequence</a>, arXiv:2209.04108 [math.CO], Sep 11 2022. %H A354774 Rémy Sigrist, <a href="/A354774/a354774.txt">C++ program</a> %H A354774 N. J. A. Sloane, <a href="/A354767/a354767.txt">A conjectured generating function for A354169.</a> %F A354774 Conjecture from _N. J. A. Sloane_, Jun 29 2022: (Start) %F A354774 The following is a conjectured explicit formula for a(n). Basically a(n) = n+2, except that there are four types of n which have a different formula, and there are 6 exceptional values for small n. %F A354774 Here is the formula, which agrees with the first 10000 terms. %F A354774 (I) If n = 3*2^(k-1)-3, k >= 2 then a(n) = (n+1)/2, except a(3) = a(9) = 4 and a(21) = 5. %F A354774 (II) If n = 2^(k+1)-3, k >= 1 then a(n) = (n+1)/2, except a(5) = a(13) = 6 and a(29) = 7. %F A354774 (III) If n = 3*2^(k-1)-2, k >= 2 then a(n) = n+1. %F A354774 (IV) If n = 2^(k+1)-2, k >= 1 then a(n) = n+1. %F A354774 (V) Otherwise a(n) = n+2. (End) %F A354774 The conjecture is now known to be true. See De Vlieger et al. (2022). - _N. J. A. Sloane_, Aug 29 2022 %o A354774 (C++) See Links section. %o A354774 (Python) %o A354774 from itertools import count, islice %o A354774 from collections import deque %o A354774 from functools import reduce %o A354774 from operator import or_ %o A354774 def A354774_gen(): # generator of terms %o A354774 aset, aqueue, b, f = {0,1,2}, deque([2]), 2, False %o A354774 while True: %o A354774 for k in count(1): %o A354774 m, j, j2, r, s = 0, 0, 1, b, k %o A354774 while r > 0: %o A354774 r, q = divmod(r,2) %o A354774 if not q: %o A354774 s, y = divmod(s,2) %o A354774 m += y*j2 %o A354774 j += 1 %o A354774 j2 *= 2 %o A354774 if s > 0: %o A354774 m += s*2**b.bit_length() %o A354774 if m not in aset: %o A354774 if (s := bin(m)[3:]).count('1') == 1: %o A354774 yield len(s) %o A354774 aset.add(m) %o A354774 aqueue.append(m) %o A354774 if f: aqueue.popleft() %o A354774 b = reduce(or_,aqueue) %o A354774 f = not f %o A354774 break %o A354774 A354774_list = list(islice(A354774_gen(),30)) # _Chai Wah Wu_, Jun 27 2022 %Y A354774 Cf. A354169, A354680, A354767, A354798, A354773, A354775. %K A354774 nonn %O A354774 1,2 %A A354774 _N. J. A. Sloane_, Jun 26 2022