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.

A216649 Triangle T(n,k) in which n-th row lists in increasing order all positive integers with a representation as totally balanced 2n digit binary string such that all consecutive totally balanced substrings are in nondecreasing order; n>=1, 1<=k<=A000081(n+1).

Original entry on oeis.org

2, 10, 12, 42, 44, 52, 56, 170, 172, 180, 184, 204, 212, 216, 232, 240, 682, 684, 692, 696, 716, 724, 728, 744, 752, 820, 824, 852, 856, 872, 880, 920, 936, 944, 976, 992, 2730, 2732, 2740, 2744, 2764, 2772, 2776, 2792, 2800, 2868, 2872, 2900, 2904, 2920, 2928
Offset: 1

Views

Author

Alois P. Heinz, Sep 12 2012

Keywords

Comments

There is a simple bijection between the elements of row n and the rooted trees with n+1 nodes. The tree has a root node. Each matching pair (1,0) in the binary string representation encodes an additional node, the totally balanced substrings encode lists of subtrees.

Examples

			172 is element of row 4, the binary string representation (with totally balanced substrings enclosed in parentheses) is (10)(10)(1(10)0).  The encoded rooted tree is:
.    o
.   /|\
.  o o o
.      |
.      o
Triangle T(n,k) begins:
2;
10,     12;
42,     44,   52,   56;
170,   172,  180,  184,  204,  212,  216,  232,  240;
682,   684,  692,  696,  716,  724,  728,  744,  752,  820,  824, ...
2730, 2732, 2740, 2744, 2764, 2772, 2776, 2792, 2800, 2868, 2872, ...
Triangle T(n,k) in binary:
10;
1010,       1100;
101010,     101100,     110100,     111000;
10101010,   10101100,   10110100,   10111000,   11001100,   11010100, ...
1010101010, 1010101100, 1010110100, 1010111000, 1011001100, 1011010100, ...
		

Crossrefs

First column gives: A020988.
Last elements of rows give: A020522.
Row lengths are: A000081(n+1).
Subsequence of A014486, A031443.

Programs

  • Maple
    F:= proc(n) option remember; `if`(n=1, [10], sort(map(h->
          parse(cat(1, sort(h)[], 0)), g(n-1, n-1)))) end:
    g:= proc(n, i) option remember; `if`(i=1, [[10$n]], [seq(seq(seq(
          [seq (F(i)[w[t]-t+1], t=1..j),v[]], w=combinat[choose](
          [$1..nops(F(i))+j-1], j)), v=g(n-i*j, i-1)), j=0..n/i)])
        end:
    b:= proc(n) local h, i, r; h, r:= n/10, 0; for i from 0
          while h>1 do r:= r+2^i*irem(h, 10, 'h') od; r
        end:
    T:= proc(n) option remember; map(b, F(n+1))[] end:
    seq(T(n), n=1..6);

Formula

T(n,k) = A216648(n+1,k)/2 - 2^(2*n).