%I #14 Oct 17 2019 18:01:23
%S 1,8,54,368,2649,20544,172596,1569408,15398829,162412416,1834081890,
%T 22093090560,282889238253,3837991053312,55010010678120,
%U 830731742908416,13185328329110745,219457733809563648,3822426663111579150,69538569862816419840,1318999546575572747265
%N Number of permutations of [n] containing exactly one occurrence of the consecutive pattern 132.
%H Alois P. Heinz, <a href="/A263885/b263885.txt">Table of n, a(n) for n = 3..200</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/InverseErf.html">Inverse Erf</a>
%F a(n) = A197365(n,1).
%F a(n) ~ c * d^n * n! * n, where d = 1/A240885 = 1/(sqrt(2) * InverseErf(sqrt(2/Pi))) = 0.78397693120354749... and c = 0.679554202696108785... . - _Vaclav Kotesovec_, Oct 29 2015
%e a(3) = 1: 132.
%e a(4) = 8: 1243, 1324, 1423, 1432, 2143, 2431, 3142, 4132.
%e a(5) = 54: 12354, 12435, 12534, ..., 52431, 53142, 54132.
%e a(6) = 368: 123465, 123546, 123645, ..., 652431, 653142, 654132.
%e a(7) = 2649: 1234576, 1234657, 1234756, ..., 7652431, 7653142, 7654132.
%p b:= proc(u, o, t, c) option remember; `if`(u+o=0, c, add(
%p b(u-j, o+j-1, 0, c+`if`(j<=t, 1, 0)), j=`if`(c=1, t, 0)
%p +1..u) +add(b(u+j-1, o-j, j-1, c), j=1..o))
%p end:
%p a:= n-> b(n, 0$3):
%p seq(a(n), n=3..30);
%t Drop[Coefficient[CoefficientList[Series[1/(1 - (Sqrt[Pi/2]*Erfi[(Sqrt[u-1]*x) / Sqrt[2]])/Sqrt[u-1]), {x, 0, 25}], x] * Range[0, 25]!, u], 3] (* _Vaclav Kotesovec_, Oct 29 2015 *)
%Y Column k=1 of A197365.
%K nonn
%O 3,2
%A _Alois P. Heinz_, Oct 28 2015
|