This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A159139 #25 Feb 16 2025 08:33:10 %S A159139 1,37,891,18043,337210,6081686,108469917,1941309261,35187952132, %T A159139 649951312000,12286366975723,238445927000811,4762398793018878, %U A159139 98074791689121162,2085684931155975120,45859509146309390064,1043533983233372354613,24590543663448304800169 %N A159139 Number of permutations of 1..n containing the relative rank sequence { 213465 } at any spacing. %C A159139 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 A159139 Alois P. Heinz, <a href="/A159139/b159139.txt">Table of n, a(n) for n = 6..200</a> %H A159139 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PermutationPattern.html">Permutation Pattern</a> %F A159139 a(n) = A214152(n,6) = A000142(n)-A047890(n) = A000142(n)-A214015(n,5). - _Alois P. Heinz_, Jul 05 2012 %p A159139 h:= proc(l) local n; n:=nops(l); add(i, i=l)! /mul(mul(1+l[i]-j %p A159139 +add(`if`(l[k]>=j, 1, 0), k=i+1..n), j=1..l[i]), i=1..n) %p A159139 end: %p A159139 g:= proc(n, i, l) %p A159139 `if`(n=0 or i=1, h([l[], 1$n])^2, `if`(i<1, 0, %p A159139 add(g(n-i*j, i-1, [l[], i$j]), j=0..n/i))) %p A159139 end: %p A159139 a:= n-> n! -g(n, 5, []): %p A159139 seq(a(n), n=6..30); # _Alois P. Heinz_, Jul 05 2012 %p A159139 # second Maple program %p A159139 a:= proc(n) option remember; `if`(n<6, 0, `if`(n=6, 1, %p A159139 ((2475-4819*n^2-2985*n+175*n^4-1021*n^3+n^6+49*n^5)*a(n-1) %p A159139 -(35*n^4+441*n^3-845*n^2-4147*n-489)*(n-1)^2*a(n-2) %p A159139 +(-1668+329*n+259*n^2)*(n-1)^2*(n-2)^2*a(n-3) %p A159139 -225*(n-1)^2*(n-2)^2*(n-3)^2*a(n-4))/ ((n-6)*(n+6)^2*(n+4)^2))) %p A159139 end: %p A159139 seq(a(n), n=6..30); # _Alois P. Heinz_, Sep 26 2012 %t A159139 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 A159139 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 A159139 a[n_] := n! - g[n, 5, {}]; %t A159139 Table[a[n], {n, 6, 30}] (* _Jean-François Alcover_, Jun 19 2018, from first Maple program *) %Y A159139 Cf. A000142, A047890, A056986, A158005, A158423, A214015, A214152. %K A159139 nonn %O A159139 6,2 %A A159139 _R. H. Hardin_, Apr 05 2009 %E A159139 More terms from _Alois P. Heinz_, Jul 05 2012