cp's OEIS Frontend

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.

A362241 Binary encoding of the rows of A362240.

Original entry on oeis.org

0, 1, 0, 3, 0, 5, 7, 0, 10, 13, 0, 3, 4, 7, 14, 31, 4, 9, 13, 15, 17, 20, 27, 28, 37, 44, 51, 53, 63, 2, 15, 17, 20, 28, 31, 41, 44, 46, 48, 53, 58, 71, 78, 99, 101, 123, 2, 5, 7, 11, 17, 19, 24, 35, 39, 41, 55, 58, 63, 72, 83, 85, 89, 97, 107, 111, 113, 134
Offset: 1

Views

Author

Samuel Harkness, Apr 12 2023

Keywords

Examples

			The sequence begins:
   n    a(n)     A362240 row
  ---   ----     -----------
    1     0      0;
    2     1      1;
    3     0      0, 0;
    4     3      1, 1;
    5     0      0, 0, 0;
    6     5      1, 0, 1;
    7     7      1, 1, 1;
    8     0      0, 0, 0, 0;
    9    10      1, 0, 1, 0;
   10    13      1, 1, 0, 1;
   11     0      0, 0, 0, 0, 0;
   12     3      0, 0, 0, 1, 1;
   13     4      0, 0, 1, 0, 0;
		

Crossrefs

Programs

  • MATLAB
    See Links section.
    
  • Mathematica
    V = {0}; K = {0}; B = {0}; While[Length@B < 68, y = 0; While[y == 0, i = Length@V; V[[i]]++; While[V[[i]] == 2 && i > 1 , V[[i]] = 0; i--; V[[i]]++]; If[V[[1]] == 2, V = ConstantArray[0, Length@V + 1]]; z = 0; For[a = 1, a <= Length@K - Length@V + 1, a++, If[K[[a ;; a + Length@V - 1]] == V, z = 1; Break[]]]; If[z == 0, AppendTo[K, V]; b = 0; For[c = Length@V, c > 0, c--, b += V[[c]]*2^(Length@V - c)]; AppendTo[B, b]; K = Flatten[K]; y = 1]]]; Print[B]
  • Python
    from itertools import count, islice, product
    def bins(): yield from ("".join(b) for d in count(1) for b in product("01", repeat=d))
    def agen(s=""): yield from (int(t, 2) for t in bins() if t not in s and (s:=s+t))
    print(list(islice(agen(), 68))) # Michael S. Branicky, Apr 12 2023

Formula

a(n) = A053645(A362009(n) + 1).