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 A382645 #23 Apr 09 2025 21:15:07 %S A382645 1,0,0,0,2,10,68,500,4174,38774,397584,4462848,54455754,717909202, %T A382645 10171232060,154142811052,2488421201446,42636471916622, %U A382645 772807552752712,14774586965277816,297138592463202402,6271277634164008170,138596853553771517492,3200958202120445923684,77114612783976599209598 %N A382645 Number of king permutations on n elements not beginning with the smallest element and not ending with the largest element. %C A382645 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. %H A382645 Dan Li and Philip B. Zhang, <a href="https://arxiv.org/abs/2411.18131">Distributions of mesh patterns of short lengths on king permutations</a>, arXiv:2411.18131 [math.CO], 2024. See formula (3) at page 5. %F A382645 G.f.: t/(1+t) + Sum_{n >= 0} n!*t^n*(1-t)^n/(1+t)^(n+2). %F A382645 a(n) ~ exp(-2) * n!. - _Vaclav Kotesovec_, Apr 04 2025 %e A382645 For n = 4 the a(4) = 2 solutions are the two permutations 2413 and 3142. %e A382645 For n = 5 the a(5) = 10 solutions are these 10 permutations: 24153, 25314, 31524, 35142, 35241, 41352, 42513, 42531, 52413, and 53142. %t A382645 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 *) %o A382645 (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 %Y A382645 Cf. A002464, A382644. %K A382645 nonn %O A382645 0,5 %A A382645 _Dan Li_, Apr 01 2025