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.

A002777 Restricted permutations.

Original entry on oeis.org

1, 0, 0, 0, 4, 16, 80, 672, 4896, 49920, 460032, 5598720, 62584320, 885381120, 11644323840, 187811205120, 2841958748160, 51481298534400, 881192033648640, 17714783352913920, 338434210452602880, 7477275543168614400
Offset: 0

Views

Author

Keywords

References

  • T. Muir, The Theory of Determinants in the Historical Order of Development. 4 vols., Macmillan, NY, 1906-1923, Vol. 3, p. 468.
  • Todd Simpson, Permutations with unique fixed and reflected points. Ars Combin. 39 (1995), 97-108.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A003471.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<5, [1, 0$3, 4][n+1],
          (n-1)*a(n-1)+2*`if`(n::even, (n-2)*a(n-3), (n-1)*a(n-2)))
        end:
    seq(a(n), n=0..23);  # Alois P. Heinz, Jun 27 2020
  • Mathematica
    nmax = 20; b = ConstantArray[0, nmax+1]; b[[1]] = 1; b[[2]] = 0; b[[3]] = 0; b[[4]] = 0; b[[5]] = 4; Do[b[[n+1]] = (n-1)*b[[n]] + If[EvenQ[n],2*(n-2)*b[[n-2]],2*(n-1)*b[[n-1]]], {n, 5, nmax}]; b (* Vaclav Kotesovec, Mar 07 2014 *)

Formula

a(n) = (n-1)*a(n-1) + 2*(n-d)*a(n-e), where (d, e) = (2, 3) if n even, (1, 2) if n odd.
Recurrence (for n>=7): (3*n^2 - 17*n + 23)*a(n) = (3*n^2 - 17*n + 21)*a(n-1) + (3*n^4 - 23*n^3 + 63*n^2 - 74*n + 34)*a(n-2) - 4*(n-3)*(n-2)*a(n-3) + 2*(n-4)*(n-3)*(3*n^2 - 11*n + 9)*a(n-4). - Vaclav Kotesovec, Mar 07 2014
a(n) ~ c * n!, where c = 5*sinh(sqrt(2))/2^(3/2) - 3*cosh(sqrt(2))/2 = 0.15347184510862040153106983922669125715345689997588202335369... - Vaclav Kotesovec, Mar 07 2014, updated Apr 20 2024

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Sep 24 2001