login
Number of permutations of [2n+1] with exactly n rising or falling successions.
2

%I #12 Apr 21 2022 05:22:25

%S 1,4,48,888,22120,685368,25344480,1087931184,53138966904,

%T 2909014993080,176372774697856,11729862804913680,848948339328178128,

%U 66420006805308507568,5585680154203107163200,502437191145813112268640,48134705092961286591532440

%N Number of permutations of [2n+1] with exactly n rising or falling successions.

%H Alois P. Heinz, <a href="/A322296/b322296.txt">Table of n, a(n) for n = 0..347</a>

%F a(n) = A001100(2n+1,n).

%p S:= proc(n) option remember; `if`(n<4, [1, 1, 2*t, 4*t+2*t^2]

%p [n+1], expand((n+1-t)*S(n-1) -(1-t)*(n-2+3*t)*S(n-2)

%p -(1-t)^2*(n-5+t)*S(n-3) +(1-t)^3*(n-3)*S(n-4)))

%p end:

%p a:= n-> coeff(S(2*n+1), t, n):

%p seq(a(n), n=0..20);

%t S[n_] := S[n] = If[n < 4, {1, 1, 2*t, 4*t + 2*t^2}[[n + 1]], Expand[

%t (n + 1 - t)*S[n - 1] -

%t (1 - t)*(n - 2 + 3*t)*S[n - 2] -

%t (1 - t)^2*(n - 5 + t)*S[n - 3] +

%t (1 - t)^3*(n - 3)*S[n - 4]]];

%t a[n_] := Coefficient[S[2*n + 1], t, n];

%t Table[a[n], {n, 0, 20}] (* _Jean-François Alcover_, Apr 21 2022, after _Alois P. Heinz_ *)

%Y Bisection (odd part) of A322294.

%Y Cf. A001100.

%K nonn

%O 0,2

%A _Alois P. Heinz_, Dec 02 2018