%I #26 Mar 24 2024 03:17:06
%S 1,1,2,6,24,120,719,5022,40064,359400,3580896,39233867,468818397,
%T 6067548429,84551873634,1262188317534,20095114167065,339883289813330,
%U 6086154606429378,115025120586250896,2288119443771888504,47787869441095495395,1045507132393256095282
%N Number of permutations that avoid the generalized pattern 12345-6.
%H Alois P. Heinz, <a href="/A071088/b071088.txt">Table of n, a(n) for n = 0..450</a>
%H Sergey Kitaev, <a href="https://web.archive.org/web/20040902121307/http://www.ms.uky.edu/~kitaev/index_files/Papers/partial_order_patterns_perm.pdf">Partially Ordered Generalized Patterns</a>, preprint.
%H Sergey Kitaev, <a href="http://dx.doi.org/10.1016/j.disc.2004.03.017">Partially Ordered Generalized Patterns</a>, Discrete Math. 298 (2005), no. 1-3, 212-229.
%F E.g.f.: exp(int(A(y), y=0..x)), where A(y) = 1/(Sum_{i>=0} y^{5*i}/(5*i)! - Sum_{i>=0} y^{5*i+1}/(5*i+1)!).
%F Let b(n) = A177523(n) = number of permutations of [n] that avoid the consecutive pattern 12345. Then a(n) = Sum_{i = 0..n-1} binomial(n-1,i)*b(i)*a(n-1-i) with a(0) = b(0) = 1. [See the recurrence for A_n and B_n in the proof of Theorem 13 in Kitaev's papers.] - _Petros Hadjicostas_, Nov 01 2019
%p b:= proc(u, o, t) option remember; `if`(u+o=0, 1, add(
%p `if`(t=3 and o>j, 0, b(u+j-1, o-j, t+1)), j=1..o)+
%p add(b(u-j, o+j-1, 0), j=1..u))
%p end:
%p a:= n-> b(n, 0$2):
%p seq(a(n), n=0..25); # _Alois P. Heinz_, Nov 14 2015
%t b[u_, o_, t_] := b[u, o, t] = If[u+o == 0, 1, Sum[If[t == 3 && o > j, 0, b[u+j-1, o-j, t+1]], {j, 1, o}] + Sum[b[u-j, o+j-1, 0], {j, 1, u}]];
%t a[n_] := b[n, 0, 0];
%t a /@ Range[0, 25] (* _Jean-François Alcover_, Nov 02 2020, after _Alois P. Heinz_ *)
%Y Cf. A071075, A071076, A071077, A177523.
%K nonn
%O 0,3
%A _Sergey Kitaev_, May 26 2002
%E More terms from _Vladeta Jovovic_, May 28 2002