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.

Showing 1-4 of 4 results.

A188493 a(n) = A188491(n-1) + A188495(n-1) + A188497(n-1).

Original entry on oeis.org

0, 0, 2, 6, 14, 31, 104, 344, 1084, 3236, 9784, 29964, 92241, 282780, 865064, 2646292, 8102454, 24813838, 75982346, 232630527, 712230076, 2180675264, 6676819512, 20443032008, 62591840320, 191641545768, 586762729889, 1796535598952, 5500587026592
Offset: 0

Views

Author

N. J. A. Sloane, Apr 01 2011

Keywords

Comments

For n >= 2, a(n) is the number of permutations p on the set [n] with the properties that abs(p(i)-i) <= 3 for all i, p(j) <= 2+j for j = 1,2, and p(j) >= j-2 for j = 4,5.
For n >= 2, 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 zeros in the (1,4) and (2,5)-entries), ones on its three subdiagonals (with the exception of zeros in the (4,1) and (5,2)-entries), and is zero elsewhere.
This is row 7 of Kløve's Table 3.

Programs

  • Maple
    with (LinearAlgebra):
    A188493:= n-> `if` (n<=1, 0, Permanent (Matrix (n, (i, j)->
                  `if` (abs(j-i)<4 and [i, j]<>[4, 1] and [i, j]<>[5, 2] and [i, j]<>[1, 4] and [i, j]<>[2, 5], 1, 0)))):
    seq (A188493(n), n=0..20);
  • Mathematica
    a[n_] := Permanent[Table[If[Abs[j - i] < 4 && {i, j} != {4, 1} && {i, j} != {5, 2} && {i, j} != {1, 4} && {i, j} != {2, 5}, 1, 0], {i, 1, n}, {j, 1, n}] ]; a[1] = 0; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 0, 20}] (* Jean-François Alcover, Jan 06 2016, adapted from Maple *)

Formula

G.f.: -(x^10+2*x^9+2*x^7 +4*x^6-2*x^5-6*x^4 -9*x^3-2*x^2+2*x+2) *x^2 / (x^14 +2*x^13+2*x^11 +4*x^10-2*x^9-10*x^8 -16*x^7-2*x^6+8*x^5 +10*x^4 +2*x^2 +2*x-1). - Alois P. Heinz, Apr 08 2011

Extensions

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

A002526 Number of permutations of length n within distance 3 of a fixed permutation.

Original entry on oeis.org

1, 1, 2, 6, 24, 78, 230, 675, 2069, 6404, 19708, 60216, 183988, 563172, 1725349, 5284109, 16177694, 49526506, 151635752, 464286962, 1421566698, 4352505527, 13326304313, 40802053896, 124926806216, 382497958000, 1171122069784, 3585709284968, 10978628154457
Offset: 0

Views

Author

Keywords

Comments

For positive n, a(n) equals the permanent of the n X n matrix with 1's along the seven central diagonals, and 0's everywhere else. - John M. Campbell, Jul 09 2011

References

  • D. H. Lehmer, Permutations with strongly restricted displacements. Combinatorial theory and its applications, II (Proc. Colloq., Balatonfured, 1969), pp. 755-770. North-Holland, Amsterdam, 1970.
  • 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

The 14 sequences in Kløve's Table 3 are A002526, A002527, A002529, A188379, A188491, A188492, A188493, A188494, A002528, A188495, A188496, A188497, A188498, A002526.
Cf. A002524.
Column k=3 of A306209.

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 50); Coefficients(R!( (1-x-2*x^2-2*x^4+x^7+x^8)/(1-2*x-2*x^2-10*x^4-8*x^5+2*x^6+16*x^7+10*x^8 +2*x^9-4*x^10-2*x^11-2*x^13-x^14) )); // G. C. Greubel, Jan 22 2022
    
  • Mathematica
    CoefficientList[Series[(1-x-2x^2-2x^4+x^7+x^8)/(1-2x-2x^2-10x^4-8x^5+ 2x^6+ 16x^7+10x^8+2x^9-4x^10-2x^11-2x^13-x^14),{x,0,50}],x] (* or *) LinearRecurrence[{2,2,0,10,8,-2,-16,-10,-2,4,2,0,2,1},{1,1,2,6,24,78, 230, 675,2069,6404,19708,60216,183988,563172},51] (* Harvey P. Dale, Jun 22 2011 *)
  • PARI
    Vec((1-x-2*x^2-2*x^4+x^7+x^8)/(1-2*x-2*x^2-10*x^4-8*x^5+2*x^6+16*x^7+10*x^8+2*x^9-4*x^10-2*x^11-2*x^13-x^14)+O(x^99)) \\ Charles R Greathouse IV, Jul 16 2011
    
  • Sage
    [( (1-x-2*x^2-2*x^4+x^7+x^8)/(1-2*x-2*x^2-10*x^4-8*x^5+2*x^6+16*x^7+10*x^8 +2*x^9-4*x^10-2*x^11-2*x^13-x^14) ).series(x,n+1).list()[n] for n in (0..40)] # G. C. Greubel, Jan 22 2022

Formula

G.f.: (1-x-2*x^2-2*x^4+x^7+x^8)/(1-2*x-2*x^2-10*x^4-8*x^5+2*x^6+16*x^7+10*x^8 +2*x^9-4*x^10-2*x^11-2*x^13-x^14).
a(0)=1, a(1)=1, a(2)=2, a(3)=6, a(4)=24, a(5)=78, a(6)=230, a(7)=675, a(8)=2069, a(9)=6404, a(10)=19708, a(11)=60216, a(12)=183988, a(13)=563172, a(n) = 2*a(n-1) +2*a(n-2) +10*a(n-4) +8*a(n-5) -2*a(n-6) -16*a(n-7) -10*a(n-8) -2*a(n-9) +4*a(n-10) +2*a(n-11) +2*a(n-13) +a(n-14). - Harvey P. Dale, Jun 22 2011

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

A188498 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(j) >= 2 for j=3,4.

Original entry on oeis.org

0, 1, 2, 3, 8, 30, 102, 308, 905, 2744, 8473, 26112, 79924, 244204, 747160, 2288521, 7009458, 21461803, 65704200, 201162258, 615922714, 1885853660, 5774072225, 17678809840, 54128358209, 165728860112, 507424764216, 1553620027784, 4756831354752
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 zeros in the (1,3) and (1,4)-entries), 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 13 of Kløve's Table 3.

Programs

  • Maple
    with(LinearAlgebra):
    A188498:= n-> `if` (n=0, 0, Permanent (Matrix (n, (i, j)->
                  `if` (abs(j-i)<4 and [i, j]<>[1, 3] and [i, j]<>[1, 4] and [i, j]<>[3, 1] and [i, j]<>[4, 1], 1, 0)))):
    seq (A188498(n), n=0..20);
  • Mathematica
    a[n_] := Permanent[Table[If[Abs[j - i] < 4 && {i, j} != {1, 3} && {i, j} != {1, 4} && {i, j} != {3, 1} && {i, j} != {4, 1}, 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 07 2016, adapted from Maple *)
    CoefficientList[Series[-(x^10 + 2 x^9 + x^8 - 2 x^6 - 2 x^5 - 2 x^4 - 3 x^3 + x) / (x^14 + 2 x^13 + 2 x^11 + 4 x^10 - 2 x^9 - 10 x^8 - 16 x^7 - 2 x^6 + 8 x^5 + 10 x^4 + 2 x^2 + 2 x - 1), {x, 0, 33}], x] (* Vincenzo Librandi, Jan 07 2016 *)
  • PARI
    concat(0, Vec(-(x^10+2*x^9+x^8 -2*x^6-2*x^5-2*x^4 -3*x^3+x) / (x^14+2*x^13+2*x^11 +4*x^10-2*x^9-10*x^8 -16*x^7-2*x^6+8*x^5 +10*x^4+2*x^2+2*x-1) + O(x^40))) \\ Michel Marcus, Dec 12 2014

Formula

From Nathaniel Johnston, Apr 11 2011: (Start)
a(n) = A188497(n+1) - A188494(n).
a(n) = A002526(n-1) + A002526(n-2).
(End)
G.f.: -(x^10 + 2*x^9 + x^8 - 2*x^6 - 2*x^5 - 2*x^4 - 3*x^3 + x) / (x^14 + 2*x^13 + 2*x^11 + 4*x^10 - 2*x^9 - 10*x^8 - 16*x^7 - 2*x^6 + 8*x^5 + 10*x^4 + 2*x^2 + 2*x - 1).

Extensions

Name and comments edited, and a(12)-a(28) from Nathaniel Johnston, Apr 11 2011
Showing 1-4 of 4 results.