login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A242820 Number T(n,k) of permutations of [n] with exactly k occurrences of the consecutive step pattern up, down, down, down; triangle T(n,k), n>=0, 0<=k<=max(0,floor((n-1)/4)), read by rows. 4

%I #14 Mar 23 2021 16:13:13

%S 1,1,2,6,24,116,4,672,48,4536,504,34944,5376,302896,59488,496,2916992,

%T 697856,13952,30899616,8720448,296736,357080064,116109312,5812224,

%U 4470310976,1645662912,110697408,349504,60269056512,24776769024,2114735616,17730048

%N Number T(n,k) of permutations of [n] with exactly k occurrences of the consecutive step pattern up, down, down, down; triangle T(n,k), n>=0, 0<=k<=max(0,floor((n-1)/4)), read by rows.

%H Alois P. Heinz, <a href="/A242820/b242820.txt">Rows n = 0..140, flattened</a>

%e T(5,1) = 4: (1,5,4,3,2), (2,5,4,3,1), (3,5,4,2,1), (4,5,3,2,1).

%e Triangle T(n,k) begins:

%e : 0 : 1;

%e : 1 : 1;

%e : 2 : 2;

%e : 3 : 6;

%e : 4 : 24;

%e : 5 : 116, 4;

%e : 6 : 672, 48;

%e : 7 : 4536, 504;

%e : 8 : 34944, 5376;

%e : 9 : 302896, 59488, 496;

%e : 10 : 2916992, 697856, 13952;

%e : 11 : 30899616, 8720448, 296736;

%p b:= proc(u, o, t) option remember; `if`(u+o=0, 1, expand(

%p add(b(u-j, o+j-1, [1, 3, 4, 1][t])*`if`(t=4, x, 1), j=1..u)+

%p add(b(u+j-1, o-j, 2), j=1..o)))

%p end:

%p T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0, 1)):

%p seq(T(n), n=0..15);

%t b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, 1, Expand[

%t Sum[b[u - j, o + j - 1, {1, 3, 4, 1}[[t]]]*If[t==4, x, 1], {j, 1, u}]+

%t Sum[b[u + j - 1, o - j, 2], {j, 1, o}]]];

%t T[n_] := CoefficientList[b[n, 0, 1], x];

%t T /@ Range[0, 15] // Flatten (* _Jean-François Alcover_, Mar 23 2021, after _Alois P. Heinz_ *)

%Y Column k=0 gives A177518.

%Y Row sums give: A000142.

%Y Cf. A242783, A242784, A295987.

%K nonn,tabf

%O 0,3

%A _Alois P. Heinz_, May 23 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)