Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #24 Jun 19 2018 05:09:00
%S 1,37,891,18043,337210,6081686,108469917,1941309261,35187952132,
%T 649951312000,12286366975723,238445927000811,4762398793018878,
%U 98074791689121162,2085684931155975120,45859509146309390064,1043533983233372354613,24590543663448304800169
%N Number of permutations of 1..n containing the relative rank sequence { 213465 } at any spacing.
%C Same series for 654321 123456 564321 213456 123465 654312 456321 321456 123654 654123 345621 432156 126543 651234 564312 456312 321465 213654 564123 345612 432165 216543 561234 234561 543216 165432 612345 456123 321654.
%H Alois P. Heinz, <a href="/A159139/b159139.txt">Table of n, a(n) for n = 6..200</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PermutationPattern.html">Permutation Pattern</a>
%F a(n) = A214152(n,6) = A000142(n)-A047890(n) = A000142(n)-A214015(n,5). - _Alois P. Heinz_, Jul 05 2012
%p h:= proc(l) local n; n:=nops(l); add(i, i=l)! /mul(mul(1+l[i]-j
%p +add(`if`(l[k]>=j, 1, 0), k=i+1..n), j=1..l[i]), i=1..n)
%p end:
%p g:= proc(n, i, l)
%p `if`(n=0 or i=1, h([l[], 1$n])^2, `if`(i<1, 0,
%p add(g(n-i*j, i-1, [l[], i$j]), j=0..n/i)))
%p end:
%p a:= n-> n! -g(n, 5, []):
%p seq(a(n), n=6..30); # _Alois P. Heinz_, Jul 05 2012
%p # second Maple program
%p a:= proc(n) option remember; `if`(n<6, 0, `if`(n=6, 1,
%p ((2475-4819*n^2-2985*n+175*n^4-1021*n^3+n^6+49*n^5)*a(n-1)
%p -(35*n^4+441*n^3-845*n^2-4147*n-489)*(n-1)^2*a(n-2)
%p +(-1668+329*n+259*n^2)*(n-1)^2*(n-2)^2*a(n-3)
%p -225*(n-1)^2*(n-2)^2*(n-3)^2*a(n-4))/ ((n-6)*(n+6)^2*(n+4)^2)))
%p end:
%p seq(a(n), n=6..30); # _Alois P. Heinz_, Sep 26 2012
%t h[l_] := With[{n = Length[l]}, Sum[i, {i, l}]!/Product[Product[1+l[[i]] - j + Sum[If[l[[k]] >= j, 1, 0], {k, i+1, n}], {j, 1, l[[i]]}], {i, 1, n}]];
%t g[n_, i_, l_] := If[n == 0 || i === 1, h[Join[l, Array[1 &, n]]]^2, If[i < 1, 0, Sum[g[n - i*j, i - 1, Join[l, Array[i &, j]]], {j, 0, n/i}]]];
%t a[n_] := n! - g[n, 5, {}];
%t Table[a[n], {n, 6, 30}] (* _Jean-François Alcover_, Jun 19 2018, from first Maple program *)
%Y Cf. A000142, A047890, A056986, A158005, A158423, A214015, A214152.
%K nonn
%O 6,2
%A _R. H. Hardin_, Apr 05 2009
%E More terms from _Alois P. Heinz_, Jul 05 2012