A177548 Number of permutations of {1,...,n} avoiding adjacent step pattern up, up, down, down, down, down.
1, 1, 2, 6, 24, 120, 720, 5025, 40080, 359640, 3585600, 39322800, 470448000, 6097392939, 85106238492, 1272746220570, 20302567148160, 344103461618400, 6175195781293440, 116975122363277289, 2332451810975205960, 48833870901559002540, 1071107370496773577440
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..175
Crossrefs
Columns k=48,60 of A242784.
Programs
-
Maple
b:= proc(u, o, t) option remember; `if`(t>6, 0, `if`(u+o+t<7, (u+o)!, add(b(u-j, o+j-1, [1, 1, 4, 5, 6, 7][t]), j=1..u)+ add(b(u+j-1, o-j, [2, 3, 3, 2, 2, 2][t]), j=1..o))) end: a:= n-> b(n, 0, 1): seq(a(n), n=0..25); # Alois P. Heinz, Oct 23 2013
-
Mathematica
b[u_, o_, t_] := b[u, o, t] = If[t > 6, 0, If[u + o + t < 7, (u + o)!, Sum[b[u - j, o + j - 1, {1, 1, 4, 5, 6, 7}[[t]]], {j, 1, u}] + Sum[b[u + j - 1, o - j, {2, 3, 3, 2, 2, 2}[[t]]], {j, 1, o}]]]; a[n_] := b[n, 0, 1]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Apr 19 2022, after Alois P. Heinz *)
Formula
a(n) ~ c * d^n * n!, where d = 0.99698626702423025316812958090212389097043667361318991688710688185165..., c = 1.018367520648807878150063272123153629935889863110044893080319840979... . - Vaclav Kotesovec, Jan 17 2015
Extensions
a(17)-a(22) from Alois P. Heinz, Oct 23 2013