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.

A152877 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} having k consecutive triples of the form (odd,even,odd) and (even,odd,even) (0<=k<=n-2).

This page as a plain text file.
%I A152877 #28 Nov 16 2019 17:01:59
%S A152877 1,1,2,4,2,16,0,8,60,24,24,12,288,144,216,0,72,1584,1296,1152,576,288,
%T A152877 144,10368,9216,10368,4608,4608,0,1152,74880,83520,86400,60480,31680,
%U A152877 17280,5760,2880,604800,748800,892800,576000,460800,172800,144000,0,28800
%N A152877 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} having k consecutive triples of the form (odd,even,odd) and (even,odd,even) (0<=k<=n-2).
%C A152877 Row n has n-1 entries (n>=2).
%C A152877 Sum of entries in row n is n! (A000142(n)).
%C A152877 T(n,0) = A152876(n).
%C A152877 T(n,n-2) = A092186(n).
%C A152877 T(2n+1,2n-2) = A047677(n) = 2*n!*(n+1)!. - _Alois P. Heinz_, Nov 10 2013
%H A152877 Alois P. Heinz, <a href="/A152877/b152877.txt">Rows n = 0..142, flattened</a>
%H A152877 E. Munarini and N. Zagaglia Salvi, <a href="http://www.emis.de/journals/SLC/wpapers/s49zagaglia.html">Binary strings without zigzags</a>, Sem. Lotharingien de Combinatoire, 49, 2004, B49h.
%F A152877 It would be good to have a formula or generating function for this sequence (a formula for column 0 is given in A152876).
%F A152877 Sum_{k>=1} k*T(n,k) = A329550(n). - _Alois P. Heinz_, Nov 16 2019
%e A152877 T(3,1) = 2 because we have 123 and 321.
%e A152877 Triangle starts:
%e A152877       1;
%e A152877       1;
%e A152877       2;
%e A152877       4,    2;
%e A152877      16,    0,     8;
%e A152877      60,   24,    24,   12;
%e A152877     288,  144,   216,    0,   72;
%e A152877    1584, 1296,  1152,  576,  288, 144;
%e A152877   10368, 9216, 10368, 4608, 4608,   0, 1152;
%e A152877   ...
%p A152877 b:= proc(o, u, t) option remember; `if`(u+o=0, 1, expand(
%p A152877       o*b(o-1, u, [2, 2, 5, 5, 2][t])*`if`(t=4, x, 1)+
%p A152877       u*b(o, u-1, [3, 4, 3, 3, 4][t])*`if`(t=5, x, 1)))
%p A152877     end:
%p A152877 T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(
%p A152877                b(ceil(n/2), floor(n/2), 1)):
%p A152877 seq(T(n), n=0..12);  # _Alois P. Heinz_, Nov 10 2013
%t A152877 b[o_, u_, t_] := b[o, u, t] = If[u+o == 0, 1, Expand[o*b[o-1, u, {2, 2, 5, 5, 2}[[t]]]*If[t == 4, x, 1] + u*b[o, u-1, {3, 4, 3, 3, 4}[[t]]]*If[t == 5, x, 1]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]] [b[Ceiling[n/2], Floor[n/2], 1]]; Table[T[n], {n, 0, 12}] // Flatten (* _Jean-François Alcover_, May 27 2015, after _Alois P. Heinz_ *)
%Y A152877 Cf. A000142, A047677, A152876, A092186, A329550.
%K A152877 nonn,tabf
%O A152877 0,3
%A A152877 _Emeric Deutsch_, Dec 17 2008
%E A152877 More terms from _Alois P. Heinz_, Nov 10 2013