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.

A382651 Number of king permutations on n elements without strict fixed points.

Original entry on oeis.org

1, 0, 0, 0, 2, 10, 68, 500, 4174, 38770, 397544, 4462476, 54452394, 717877882, 10170925492, 154139627692, 2488385952526, 42636054584106, 772802263942376, 14774515232543556, 297137552306148570, 6271261537872652418, 138596588342412866276, 3200953561821628327956, 77114526810424117688014
Offset: 0

Views

Author

Dan Li, Apr 02 2025

Keywords

Comments

A permutation p(1)p(2)...p(n) is a king permutation if |p(i+1)-p(i)|>1 for each 0

Examples

			a(4) = 2 corresponds to these two permutations: 2413, 3142.
a(5) = 10 corresponds to these 10 permutations of length 5: 24153, 25314, 31524, 35142, 35241, 41352, 42513, 42531, 52413, 53142.
		

Crossrefs

Programs

  • Mathematica
    nmax = 20; CoefficientList[Series[(1+x)/(x + (1+x)/Sum[k!*x^k*(1-x)^k/(1+x)^k, {k, 0, nmax}]), {x, 0, nmax}], x] (* Vaclav Kotesovec, Apr 04 2025 *)
  • PARI
    N=30; t='t+O('t^N);
    A=sum(n=0, N, n!*t^n*(1-t)^n/(1+t)^n);
    gf=(1 + t)*A/(1 + t + t*A);
    Vec(gf)  \\ Joerg Arndt, Apr 03 2025

Formula

G.f.: (1 + t)*A(t)/(1 + t + t*A(t)) where A(t)=Sum_{n >= 0} n!*t^n*(1-t)^n/(1+t)^n is the g.f. for king permutations given by A002464.
a(n) ~ exp(-2) * n!. - Vaclav Kotesovec, Apr 04 2025