cp's OEIS Frontend

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.

A159175 Number of permutations of 1..n containing the relative rank sequence { 1234567 } at any spacing.

This page as a plain text file.
%I A159175 #21 Feb 16 2025 08:33:10
%S A159175 1,50,1578,40884,958809,21353634,463945294,9996042284,215831724525,
%T A159175 4702905606350,103912444955422,2336099774748540,53567906041439136,
%U A159175 1255172323669315848,30095426182382305848,739238316780966277616,18619024923770934306358,481234428294016650524172
%N A159175 Number of permutations of 1..n containing the relative rank sequence { 1234567 } at any spacing.
%C A159175 Same series (among rank sequences with inversion = reversal) for 3214765 2134576.
%H A159175 Alois P. Heinz, <a href="/A159175/b159175.txt">Table of n, a(n) for n = 7..200</a>
%H A159175 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PermutationPattern.html">Permutation Pattern</a>
%F A159175 a(n) = A214152(n,7) = A000142(n)-A052399(n) = A000142(n)-A214015(n,6). - _Alois P. Heinz_, Jul 05 2012
%p A159175 h:= proc(l) local n; n:=nops(l); add(i, i=l)! /mul(mul(1+l[i]-j
%p A159175       +add(`if`(l[k]>=j, 1, 0), k=i+1..n), j=1..l[i]), i=1..n)
%p A159175     end:
%p A159175 g:= (n, i, l)-> `if`(n=0 or i=1, h([l[], 1$n])^2, `if`(i<1, 0,
%p A159175                  add(g(n-i*j, i-1, [l[], i$j]), j=0..n/i))):
%p A159175 a:= n-> n! -g(n, 6, []):
%p A159175 seq(a(n), n=7..25);  # _Alois P. Heinz_, Jul 05 2012
%p A159175 # second Maple program
%p A159175 a:= proc(n) option remember; `if`(n<7, 0, `if`(n=7, 1, ((-93464*n+1072*n^4
%p A159175       +72128-125284*n^2+84*n^6+994*n^5-30491*n^3+n^7) *a(n-1)
%p A159175       -4*(14*n^5+399*n^4+1124*n^3-7354*n^2-23983*n-5042)*(n-1)^2 *a(n-2)
%p A159175       +4*(-7359-2629*n+1596*n^2+196*n^3)*(n-1)^2*(n-2)^2 *a(n-3)
%p A159175       -1152*(1+2*n)*(n-1)^2*(n-2)^2*(n-3)^2 *a(n-4))/
%p A159175        ((n-7)*(n+9)*(n+8)^2*(n+5)^2)))
%p A159175     end:
%p A159175 seq(a(n), n=7..30);  # _Alois P. Heinz_, Sep 27 2012
%t A159175 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 A159175 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 A159175 a[n_] := n! - g[n, 6, {}];
%t A159175 Table[a[n], {n, 7, 25}] (* _Jean-François Alcover_, Jun 19 2018, from first Maple program *)
%Y A159175 Cf. A000142, A052399, A056986, A158005, A158423, A214015, A214152.
%K A159175 nonn
%O A159175 7,2
%A A159175 _R. H. Hardin_ Apr 05 2009
%E A159175 Extended beyond a(16) by _Alois P. Heinz_, Jul 05 2012