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.

A188495 Number of permutations p on the set [n] with the properties that abs(p(i)-i) <= 3 for all i, p(1) <= 2, and p(4) >= 2.

Original entry on oeis.org

0, 1, 2, 4, 10, 36, 120, 368, 1089, 3304, 10168, 31312, 95880, 293120, 896824, 2746569, 8411818, 25756220, 78853410, 241421436, 739183568, 2263249600, 6929580817, 21216729488, 64960656448, 198894856144, 608971496032, 1864533223584, 5708777321872
Offset: 0

Views

Author

N. J. A. Sloane, Apr 01 2011

Keywords

Comments

a(n) is also the permanent of the n X n matrix that has ones on its diagonal, ones on its three superdiagonals (with the exception of a zero in the (1,4)-entry), ones on its three subdiagonals (with the exception of zeros in the (3,1) and (4,1)-entries), and is zero elsewhere.
This is row 10 of Kløve's Table 3.

Programs

  • Maple
    with (LinearAlgebra):
    A188495:= n-> `if` (n=0, 0, Permanent (Matrix (n, (i, j)->
                  `if` (abs(j-i)<4 and [i, j]<>[3, 1] and [i, j]<>[4, 1] and [i, j]<>[1, 4], 1, 0)))):
    seq (A188495(n), n=0..20);
  • Mathematica
    a[n_] := Permanent[Table[If[Abs[j - i] < 4 && {i, j} != {3, 1} && {i, j} != {4, 1} && {i, j} != {1, 4}, 1, 0], {i, 1, n}, {j, 1, n}]]; a[1] = 1; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 0, 20}] (* Jean-François Alcover, Jan 06 2016, adapted from Maple *)
  • PARI
    concat(0, Vec(-x*(x +1)*(x^6 +x^5 -x^4 -x^3 -x^2 -x +1) / ((x -1)*(x^13 +3*x^12 +3*x^11 +5*x^10 +9*x^9 +7*x^8 -3*x^7 -19*x^6 -21*x^5 -13*x^4 -3*x^3 -3*x^2 -x +1)) + O(x^100))) \\ Colin Barker, Dec 13 2014

Formula

From Nathaniel Johnston, Apr 10 2011: (Start)
a(n) = A188493(n+1) - A188491(n) - A188497(n).
a(n) = A002526(n-1) + A188494(n-1).
(End)
G.f.: -x*(x +1)*(x^6 +x^5 -x^4 -x^3 -x^2 -x +1) / ((x -1)*(x^13 +3*x^12 +3*x^11 +5*x^10 +9*x^9 +7*x^8 -3*x^7 -19*x^6 -21*x^5 -13*x^4 -3*x^3 -3*x^2 -x +1)). - Colin Barker, Dec 13 2014

Extensions

Name and comments edited, and a(12)-a(28) from Nathaniel Johnston, Apr 10 2011