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.

A307796 Number T(n,k) of binary words of length n such that k is the difference of numbers of occurrences of subword 101 and subword 010; triangle T(n,k), n>=0, -floor(n/3)<=k<=floor(n/3), read by rows.

This page as a plain text file.
%I A307796 #31 Nov 15 2019 16:29:44
%S A307796 1,2,4,1,6,1,2,12,2,6,20,6,1,12,38,12,1,3,28,66,28,3,10,56,124,56,10,
%T A307796 1,24,119,224,119,24,1,4,60,236,424,236,60,4,15,134,481,788,481,134,
%U A307796 15,1,42,304,950,1502,950,304,42,1,5,114,656,1902,2838,1902,656,114,5
%N A307796 Number T(n,k) of binary words of length n such that k is the difference of numbers of occurrences of subword 101 and subword 010; triangle T(n,k), n>=0, -floor(n/3)<=k<=floor(n/3), read by rows.
%H A307796 Alois P. Heinz, <a href="/A307796/b307796.txt">Rows n = 0..250, flattened</a>
%F A307796 T(n,k) = T(n,-k).
%F A307796 Sum_{k = -floor(n/3)..floor(n/3)} T(n,k) * k^2/2 = A057711(n-2) for n > 1.
%e A307796 T(8,2) = 10: 01101101, 10101101, 10110101, 10110110, 10110111, 10111011, 10111101, 11011011, 11011101, 11101101.
%e A307796 T(8,-2) = 10: 00010010, 00100010, 00100100, 01000010, 01000100, 01001000, 01001001, 01001010, 01010010, 10010010.
%e A307796 T(9,3)  = 1: 101101101.
%e A307796 T(9,-3) = 1: 010010010.
%e A307796 Triangle T(n,k) begins:
%e A307796   :                      1                   ;
%e A307796   :                      2                   ;
%e A307796   :                      4                   ;
%e A307796   :                1,    6,   1              ;
%e A307796   :                2,   12,   2              ;
%e A307796   :                6,   20,   6              ;
%e A307796   :           1,  12,   38,  12,   1         ;
%e A307796   :           3,  28,   66,  28,   3         ;
%e A307796   :          10,  56,  124,  56,  10         ;
%e A307796   :      1,  24, 119,  224, 119,  24,  1     ;
%e A307796   :      4,  60, 236,  424, 236,  60,  4     ;
%e A307796   :     15, 134, 481,  788, 481, 134, 15     ;
%e A307796   :  1, 42, 304, 950, 1502, 950, 304, 42, 1  ;
%p A307796 b:= proc(n, t, h) option remember; `if`(n=0, 1, expand(
%p A307796       `if`(h=3, 1/x, 1)*b(n-1, [1, 3, 1][t], 2)+
%p A307796       `if`(t=3, x, 1)*b(n-1, 2, [1, 3, 1][h])))
%p A307796     end:
%p A307796 T:= n-> (p-> seq(coeff(p, x, i), i=-iquo(n, 3)..iquo(n, 3)))(b(n, 1$2)):
%p A307796 seq(T(n), n=0..15);
%t A307796 b[n_, t_, h_] := b[n, t, h] = If[n == 0, 1, Expand[If[h == 3, 1/x, 1]* b[n-1, {1, 3, 1}[[t]], 2] + If[t == 3, x, 1]*b[n-1, 2, {1, 3, 1}[[h]]]]];
%t A307796 T[n_] := Table[Coefficient[#, x, i], {i, -Quotient[n, 3], Quotient[n, 3]}]& @ b[n, 1, 1];
%t A307796 Table[T[n], {n, 0, 15}] // Flatten (* _Jean-François Alcover_, May 08 2019, after _Alois P. Heinz_ *)
%Y A307796 Columns k=0-2 give: A164146, A284449, A286209.
%Y A307796 Row sums give A000079.
%Y A307796 T(3n-4,n-2) gives A000217 for n >= 3.
%Y A307796 Cf. A002264, A057711, A303696.
%K A307796 nonn,tabf
%O A307796 0,2
%A A307796 _Alois P. Heinz_, Apr 29 2019