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 A301983 #14 Jan 26 2022 11:45:20 %S A301983 1,1,2,1,3,1,2,4,1,2,3,5,1,2,3,6,1,3,7,1,2,4,8,1,2,3,4,5,9,1,2,3,4,5, %T A301983 6,10,1,2,3,5,7,11,1,2,3,4,6,12,1,2,3,5,6,7,13,1,2,3,6,7,14,1,3,7,15, %U A301983 1,2,4,8,16,1,2,3,4,5,8,9,17,1,2,3,4,5,6 %N A301983 Irregular triangle read by rows T(n, k), n >= 1 and 1 <= k <= A301977(n): T(n, k) is the k-th positive number whose binary digits appear in order but not necessarily as consecutive digits in the binary representation of n. %C A301983 This sequence has similarities with A119709 and A165416; there we consider consecutive digits, here not. %H A301983 Rémy Sigrist, <a href="/A301983/b301983.txt">Rows n = 1..500 of triangle, flattened</a> %H A301983 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A301983 T(n, 1) = 1. %F A301983 T(n, A301977(n)) = n. %F A301983 T(2^n, k) = 2^(k-1) for any n > 0 and k = 1..n+1. %F A301983 T(2^n - 1, k) = 2^k - 1 for any n > 0 and k = 1..n. %e A301983 Triangle begins: %e A301983 1: [1] %e A301983 2: [1, 2] %e A301983 3: [1, 3] %e A301983 4: [1, 2, 4] %e A301983 5: [1, 2, 3, 5] %e A301983 6: [1, 2, 3, 6] %e A301983 7: [1, 3, 7] %e A301983 8: [1, 2, 4, 8] %e A301983 9: [1, 2, 3, 4, 5, 9] %e A301983 10: [1, 2, 3, 4, 5, 6, 10] %e A301983 11: [1, 2, 3, 5, 7, 11] %e A301983 12: [1, 2, 3, 4, 6, 12] %e A301983 13: [1, 2, 3, 5, 6, 7, 13] %e A301983 14: [1, 2, 3, 6, 7, 14] %e A301983 15: [1, 3, 7, 15] %e A301983 16: [1, 2, 4, 8, 16] %p A301983 b:= proc(n) option remember; `if`(n=0, {0}, %p A301983 map(x-> [x, 2*x+r][], b(iquo(n, 2, 'r')))) %p A301983 end: %p A301983 T:= n-> sort([(b(n) minus {0})[]])[]: %p A301983 seq(T(n), n=1..20); # _Alois P. Heinz_, Jan 26 2022 %o A301983 (PARI) T(n,k) = my (b=binary(n), s=Set(1)); for (i=2, #b, s = setunion(s, Set(apply(v -> 2*v+b[i], s)))); return (s[k]) %Y A301983 Cf. A119709, A165416, A301977 (row length). %K A301983 nonn,base,tabf %O A301983 1,3 %A A301983 _Rémy Sigrist_, Mar 30 2018