OFFSET
0,5
COMMENTS
A permutation p(1)p(2)...p(n) is a king permutation if |p(i+1)-p(i)|>1 for each 0<i<n. a(n) counts king permutations of length n that do not begin with the smallest element and do not end with the largest element.
LINKS
Dan Li and Philip B. Zhang, Distributions of mesh patterns of short lengths on king permutations, arXiv:2411.18131 [math.CO], 2024. See formula (3) at page 5.
FORMULA
G.f.: t/(1+t) + Sum_{n >= 0} n!*t^n*(1-t)^n/(1+t)^(n+2).
a(n) ~ exp(-2) * n!. - Vaclav Kotesovec, Apr 04 2025
EXAMPLE
For n = 4 the a(4) = 2 solutions are the two permutations 2413 and 3142.
For n = 5 the a(5) = 10 solutions are these 10 permutations: 24153, 25314, 31524, 35142, 35241, 41352, 42513, 42531, 52413, and 53142.
MATHEMATICA
nmax = 20; CoefficientList[Series[x/(1+x) + Sum[k!*x^k*(1-x)^k/(1+x)^(k+2), {k, 0, nmax}], {x, 0, nmax}], x] (* Vaclav Kotesovec, Apr 04 2025 *)
PROG
(PARI) my(N=30, t='t+O('t^N)); Vec(t/(1+t)+sum(n=0, N, n!*t^n*(1-t)^n/(1+t)^(n+2))) \\ Joerg Arndt, Apr 03 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Dan Li, Apr 01 2025
STATUS
approved
