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.

A376921 Number T(n,k) of binary words of length n avoiding distance (i+1) between "1" digits if the i-th bit is set in the binary representation of k; triangle T(n,k), n>=0, 0<=k<=ceiling(2^(n-1))-1, read by rows.

Original entry on oeis.org

1, 2, 4, 3, 8, 5, 6, 4, 16, 8, 9, 6, 12, 7, 8, 5, 32, 13, 15, 9, 18, 11, 11, 7, 24, 11, 12, 8, 16, 9, 10, 6, 64, 21, 25, 13, 27, 16, 17, 10, 36, 17, 16, 11, 21, 12, 13, 8, 48, 18, 21, 12, 24, 15, 14, 9, 32, 14, 15, 10, 20, 11, 12, 7
Offset: 0

Views

Author

Alois P. Heinz, Oct 10 2024

Keywords

Comments

For more information see A376033.

Examples

			Triangle T(n,k) begins:
   1;
   2;
   4,  3;
   8,  5,  6, 4;
  16,  8,  9, 6, 12,  7,  8, 5;
  32, 13, 15, 9, 18, 11, 11, 7, 24, 11, 12, 8, 16, 9, 10, 6;
  ...
		

Crossrefs

Cf. A376033.

Programs

  • Maple
    h:= proc(n) option remember; `if`(n=0, 1, 2^(1+ilog2(n))) end:
    b:= proc(n, k, t) option remember; `if`(n=0, 1, add(`if`(j=1 and
          Bits[And](t, k)>0, 0, b(n-1, k, irem(2*t+j, h(k)))), j=0..1))
        end:
    T:= (n, k)-> b(n, k, 0):
    seq(seq(T(n, k), k=0..ceil(2^(n-1))-1), n=0..7);