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-10 of 10 results.

A238888 Number A(n,k) of self-inverse permutations p on [n] with displacement of elements restricted by k: |p(i)-i| <= k, square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 3, 1, 1, 1, 2, 4, 5, 1, 1, 1, 2, 4, 8, 8, 1, 1, 1, 2, 4, 10, 15, 13, 1, 1, 1, 2, 4, 10, 22, 29, 21, 1, 1, 1, 2, 4, 10, 26, 48, 56, 34, 1, 1, 1, 2, 4, 10, 26, 66, 103, 108, 55, 1, 1, 1, 2, 4, 10, 26, 76, 158, 225, 208, 89, 1, 1, 1, 2, 4, 10, 26, 76, 206, 376, 492, 401, 144, 1
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 06 2014

Keywords

Comments

A(n,k) is exactly the number of matchings of the k-th power of the path on n vertices. Here is A(4,1): o o o o (1234); o o o--o (1243); o o--o o (1324); o--o o o (2134); o--o o--o (2143). - Pietro Codara, Feb 17 2015

Examples

			A(4,0) = 1: 1234.
A(4,1) = 5: 1234, 1243, 1324, 2134, 2143.
A(4,2) = 8: 1234, 1243, 1324, 1432, 2134, 2143, 3214, 3412.
A(4,3) = 10: 1234, 1243, 1324, 1432, 2134, 2143, 3214, 3412, 4231, 4321.
Square array A(n,k) begins:
  1,  1,   1,   1,   1,   1,   1,   1,   1, ...
  1,  1,   1,   1,   1,   1,   1,   1,   1, ...
  1,  2,   2,   2,   2,   2,   2,   2,   2, ...
  1,  3,   4,   4,   4,   4,   4,   4,   4, ...
  1,  5,   8,  10,  10,  10,  10,  10,  10, ...
  1,  8,  15,  22,  26,  26,  26,  26,  26, ...
  1, 13,  29,  48,  66,  76,  76,  76,  76, ...
  1, 21,  56, 103, 158, 206, 232, 232, 232, ...
  1, 34, 108, 225, 376, 546, 688, 764, 764, ...
		

Crossrefs

Columns k=0-10 give: A000012, A000045(n+1), A000078(n+3), A239075, A239076, A239077, A239078, A239079, A239080, A239081, A239082.
Main diagonal gives A000085.

Programs

  • Maple
    b:= proc(n, k, s) option remember; `if`(n=0, 1, `if`(n in s,
          b(n-1, k, s minus {n}), b(n-1, k, s) +add(`if`(i in s, 0,
          b(n-1, k, s union {i})), i=max(1, n-k)..n-1)))
        end:
    A:= (n, k)-> `if`(k>n, A(n, n), b(n, k, {})):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • Mathematica
    b[n_, k_, s_] := b[n, k, s] = If[n == 0, 1, If[MemberQ[s, n], b[n-1, k, DeleteCases[s, n]], b[n-1, k, s] + Sum[If[MemberQ[s, i], 0, b[n-1, k, s ~Union~ {i}]], {i, Max[1, n-k], n-1}]]]; A[n_, k_] := If[k>n, A[n, n], b[n, k, {}]]; Table[Table[A[n, d-n], {n, 0, d}], {d, 0, 12}] // Flatten (* Jean-François Alcover, Mar 12 2014, translated from Maple *)

Formula

T(n,k) = Sum_{i=0..k} A238889(n,i).

A238913 Number of self-inverse permutations p on [n] where the maximal displacement of an element equals 2.

Original entry on oeis.org

0, 0, 0, 1, 3, 7, 16, 35, 74, 153, 312, 629, 1257, 2495, 4926, 9684, 18972, 37064, 72243, 140547, 273007, 529626, 1026369, 1987260, 3844919, 7434542, 14368115, 27756229, 53600223, 103476920, 199715716, 385381128, 743520256, 1434272329, 2766414007, 5335290607
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 07 2014

Keywords

Examples

			a(3) = 1: 321.
a(4) = 3: 1432, 3214, 3412.
a(5) = 7: 12543, 14325, 14523, 21543, 32145, 32154, 34125.
a(6) = 16: 123654, 125436, 125634, 132654, 143256, 143265, 145236, 213654, 215436, 215634, 321456, 321465, 321546, 321654, 341256, 341265.
		

Crossrefs

Column k=2 of A238889.

Programs

  • Maple
    gf:= x^3*(1+x)/((x^2+x-1)*(x^4+x^3+x^2+x-1)):
    a:= n-> coeff(series(gf, x, n+1), x, n):
    seq(a(n), n=0..40);
  • Mathematica
    CoefficientList[Series[x^3 (x + 1)/((x^2 + x - 1) (x^4 + x^3 + x^2 + x - 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 09 2014 *)

Formula

G.f.: x^3*(x+1)/((x^2+x-1)*(x^4+x^3+x^2+x-1)).

A238914 Number of self-inverse permutations p on [n] where the maximal displacement of an element equals 3.

Original entry on oeis.org

0, 0, 0, 0, 2, 7, 19, 47, 117, 284, 675, 1575, 3634, 8312, 18881, 42634, 95797, 214376, 478110, 1063242, 2358703, 5221606, 11538623, 25458412, 56095424, 123458153, 271440387, 596277224, 1308849869, 2871054209, 6294182153, 13791615999, 30206220592, 66131277054
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 07 2014

Keywords

Examples

			a(4) = 2: 4231, 4321.
a(5) = 7: 15342, 15432, 35142, 42315, 42513, 43215, 45312.
a(6) = 19: 126453, 126543, 146253, 153426, 153624, 154326, 156423, 216453, 216543, 351426, 351624, 423156, 423165, 425136, 426153, 432156, 432165, 453126, 456123.
		

Crossrefs

Column k=3 of A238889.

Programs

  • Maple
    gf:= (x^3-x-2)*x^4 / ((x+1)*(x^6-x^5+x^4-3*x^3+3*x^2-3*x+1)*
         (x^4+x^3+x^2+x-1)):
    a:= n-> coeff(series(gf, x, n+1), x, n):
    seq(a(n), n=0..40);
  • Mathematica
    CoefficientList[Series[(x^3 - x - 2) x^4/((x + 1) (x^6 - x^5 + x^4 - 3 x^3 + 3 x^2 - 3 x + 1) (x^4 + x^3 + x^2 + x - 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 09 2014 *)
    LinearRecurrence[{3,-1,-1,1,-4,-2,-3,-1,1,1,1},{0,0,0,0,2,7,19,47,117,284,675},40] (* Harvey P. Dale, Jun 12 2021 *)

Formula

G.f.: (x^3-x-2)*x^4 / ((x+1) *(x^6-x^5+x^4-3*x^3+3*x^2-3*x+1) *(x^4+x^3+x^2+x-1)).

A238915 Number of self-inverse permutations p on [n] where the maximal displacement of an element equals 4.

Original entry on oeis.org

0, 0, 0, 0, 0, 4, 18, 55, 151, 399, 1061, 2792, 7252, 18572, 47051, 118291, 295718, 735776, 1823183, 4501151, 11077398, 27187053, 66567357, 162655518, 396728446, 966109074, 2349342360, 5705883591, 13842565488, 33549053111, 81238182806, 196560818348
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 07 2014

Keywords

Examples

			a(5) = 4: 52341, 52431, 53241, 54321.
a(6) = 18: 163452, 163542, 164352, 165432, 361452, 361542, 463152, 465132, 523416, 523614, 524316, 526413, 532416, 532614, 543216, 546213, 563412, 564312.
a(7) = 55: 1274563, 1274653, 1275463, ..., 5637124, 5643127, 5674123.
		

Crossrefs

Column k=4 of A238889.

Programs

  • Maple
    gf:= (x^12 -x^9 -x^8 +2*x^7 -x^6 +3*x^5 -4*x^4 -2*x^3 +x^2 +6*x +4)*x^5 /
         ((x+1)*(x^6 -x^5 +x^4 -3*x^3 +3*x^2 -3*x+1) *(x^16 +x^15 +2*x^14 +x^13 +x^12 +2*x^11 +x^10 +3*x^9 -4*x^8 -5*x^7 -9*x^6 -6*x^5 -x^4 -x^3 -2*x^2 -x+1)):
    a:= n-> coeff(series(gf, x, n+1), x, n):
    seq(a(n), n=0..40);
  • Mathematica
    CoefficientList[Series[(x^12 - x^9 - x^8 + 2 x^7 - x^6 + 3 x^5 - 4 x^4 - 2 x^3 + x^2 + 6 x + 4) x^5/((x + 1) (x^6 - x^5 + x^4 - 3 x^3 + 3 x^2 - 3 x + 1) (x^16 + x^15 + 2 x^14 + x^13 + x^12 + 2 x^11 + x^10 + 3 x^9 - 4 x^8 - 5 x^7 - 9 x^6 - 6 x^5 - x^4 - x^3 - 2 x^2 - x + 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 09 2014 *)
    LinearRecurrence[{3,0,-3,1,2,-7,-16,-7,-21,-12,-9,1,16,7,11,0,3,2,1,1,-2,-1,-1},{0,0,0,0,0,4,18,55,151,399,1061,2792,7252,18572,47051,118291,295718,735776,1823183,4501151,11077398,27187053,66567357},40] (* Harvey P. Dale, Mar 09 2023 *)

Formula

G.f.: (x^12 -x^9 -x^8 +2*x^7 -x^6 +3*x^5 -4*x^4 -2*x^3 +x^2 +6*x +4)*x^5 / ((x+1)*(x^6 -x^5 +x^4 -3*x^3 +3*x^2 -3*x+1) *(x^16 +x^15 +2*x^14 +x^13 +x^12 +2*x^11 +x^10 +3*x^9 -4*x^8 -5*x^7 -9*x^6 -6*x^5 -x^4 -x^3 -2*x^2 -x+1)).

A238916 Number of self-inverse permutations p on [n] where the maximal displacement of an element equals 5.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 10, 48, 170, 515, 1471, 4119, 11605, 32568, 90756, 250432, 684816, 1858440, 5016359, 13484339, 36124302, 96487740, 257021991, 682958487, 1810749368, 4791502490, 12657090174, 33383355375, 87928909275, 231312358250, 607831534982, 1595624166626
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 07 2014

Keywords

Examples

			a(6) = 10: 623451, 623541, 624351, 625431, 632451, 632541, 643251, 645231, 653421, 654321.
a(7) = 48: 1734562, 1734652, 1735462, ..., 6735412, 6743512, 6754312.
a(8) = 170: 12845673, 12845763, 12846573, ..., 67583124, 67845123, 67854123.
		

Crossrefs

Column k=5 of A238889.

Programs

  • Maple
    gf:= (x^34 +x^33 +x^32 -x^30 +7*x^29 +4*x^28 +5*x^27 +3*x^26 -7*x^25 +2*x^24 +2*x^22 -4*x^21 -14*x^20 -38*x^19 -8*x^18 -14*x^17 -52*x^16 +12*x^15 +26*x^14 -56*x^13 -53*x^12 +79*x^11 +79*x^10 +42*x^9 +55*x^8 +49*x^7 -26*x^6 -65*x^5 -35*x^4 +13*x^3 +34*x^2 +28*x +10)*x^6 / ((x^16 +x^15 +2*x^14 +x^13 +x^12 +2*x^11 +x^10 +3*x^9 -4*x^8 -5*x^7 -9*x^6 -6*x^5 -x^4 -x^3 -2*x^2 -x +1) *(x^32 +x^31 +x^30 -x^29 -x^28 +7*x^27 +5*x^26 +x^25 -5*x^24 -3*x^23 -x^22 -8*x^21 -16*x^20 +8*x^18 -40*x^17 -36*x^16 +20*x^14 +12*x^13 +64*x^12 +52*x^11 +19*x^10 -5*x^9 -13*x^8 -27*x^7 -19*x^6 +x^5 -x^4 -x^3 -3*x^2 -x +1)):
    a:= n-> coeff(series(gf, x, n+1), x, n):
    seq(a(n), n=0..40);
  • Mathematica
    CoefficientList[Series[(x^34 + x^33 + x^32 - x^30 + 7 x^29 + 4 x^28 + 5 x^27 + 3 x^26 - 7 x^25 + 2 x^24 + 2 x^22 - 4 x^21 - 14 x^20 - 38 x^19 - 8 x^18 - 14 x^17 - 52 x^16 + 12 x^15 + 26 x^14 - 56 x^13 - 53 x^12 + 79 x^11 + 79 x^10 + 42 x^9 + 55 x^8 + 49 x^7 - 26 x^6 - 65 x^5 - 35 x^4 + 13 x^3 + 34 x^2 + 28 x + 10) x^6/((x^16 + x^15 + 2 x^14 + x^13 + x^12 + 2 x^11 + x^10 + 3 x^9 - 4 x^8 - 5 x^7 - 9 x^6 - 6 x^5 - x^4 - x^3 - 2 x^2 - x + 1) (x^32 + x^31 + x^30 - x^29 - x^28 + 7 x^27 + 5 x^26 + x^25 - 5 x^24 - 3 x^23 - x^22 - 8 x^21 - 16 x^20 + 8 x^18 - 40 x^17 - 36 x^16 + 20 x^14 + 12 x^13 + 64 x^12 + 52 x^11 + 19 x^10 - 5 x^9 - 13 x^8 - 27 x^7 - 19 x^6 + x^5 - x^4 - x^3 - 3 x^2 - x + 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 09 2014 *)

Formula

G.f.: see Maple program.

A238917 Number of self-inverse permutations p on [n] where the maximal displacement of an element equals 6.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 26, 142, 544, 1826, 5651, 16859, 49739, 147605, 437656, 1292876, 3795660, 11066720, 32052260, 92323188, 264835528, 757301423, 2159899295, 6146377790, 17454698660, 49473876635, 139980358007, 395414558802, 1115322187106, 3141769710776
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 07 2014

Keywords

Examples

			a(7) = 26: 7234561, 7234651, 7235461, 7236541, 7243561, 7243651, 7254361, 7256341, 7264531, 7265431, 7324561, 7324651, 7325461, 7326541, 7432561, 7432651, 7452361, 7462531, 7534261, 7536241, 7543261, 7564231, 7634521, 7635421, 7643521, 7654321.
a(8) = 142: 18345672, 18345762, 18346572, ..., 78563412, 78645312, 78654312.
		

Crossrefs

Column k=6 of A238889.

Programs

  • Maple
    gf:= -(x^79 +x^78 +2*x^77 -2*x^76 -4*x^75 -2*x^74 -2*x^73 -4*x^72 -2*x^71 -16*x^70 -10*x^69 -8*x^68 +2*x^67 +6*x^66 -2*x^65 +34*x^64 +82*x^63 +248*x^62 +114*x^61 +360*x^60 -176*x^59 +16*x^58 -613*x^57 -241*x^56 +286*x^55 +200*x^54 +812*x^53 -304*x^52 -2614*x^51 -6192*x^50 -1748*x^49 -2174*x^48 +3692*x^47 +4660*x^46 +8104*x^45 -2394*x^44 -6262*x^43 -4118*x^42 -8486*x^41 -2952*x^40 +12820*x^39 +22770*x^38 +6232*x^37
    +18124*x^36 +16806*x^35 -8932*x^34 -17752*x^33 -4328*x^32 -688*x^31 -11856*x^30 +1494*x^29 +7926*x^28 -1271*x^27 -15619*x^26 -17708*x^25 -10526*x^24 -15064*x^23 -5448*x^22 +4982*x^21 +7232*x^20 +6266*x^19 +4794*x^18 +4536*x^17 -1642*x^16 -4844*x^15 -1982*x^14 +1702*x^13 +3180*x^12 +2406*x^11 +2236*x^10 +1808*x^9 +844*x^8 -232*x^7 -712*x^6 -427*x^5 -23*x^4 +132*x^3 +130*x^2 +90*x +26)*x^7 /
    (-x^96 -2*x^95 -5*x^94 -2*x^93 +x^92 +4*x^91 +x^90 -6*x^89 +7*x^88 +22*x^87 +29*x^86 +33*x^85 +91*x^84 +80*x^83 +145*x^82 -10*x^81 -131*x^80 -408*x^79 -373*x^78 -190*x^77 +37*x^76 -116*x^75 -944*x^74 -1228*x^73 -3013*x^72 -912*x^71 -41*x^70 +5598*x^69 +6515*x^68 +5412*x^67 +313*x^66 -6440*x^65 -6653*x^64 +8601*x^63 +33249*x^62
    +25690*x^61 +16607*x^60 -20970*x^59 -36849*x^58 -58454*x^57 -2951*x^56 +45112*x^55 +57779*x^54 +50354*x^53 -7307*x^52 -120264*x^51 -203634*x^50 -94356*x^49 -44544*x^48 -80*x^47 +29346*x^46 +69552*x^45 -7775*x^44 -30206*x^43 +20425*x^42 +98686*x^41 +199971*x^40 +199712*x^39 +213579*x^38 +115272*x^37 +13389*x^36 -79542*x^35 -80901*x^34
    -67351*x^33 -61223*x^32 +3440*x^31 +91*x^30 -40746*x^29 -103061*x^28 -115084*x^27 -94543*x^26 -59162*x^25 -2547*x^24 +37784*x^23 +58688*x^22 +53020*x^21 +43683*x^20 +26240*x^19 +6089*x^18 -3934*x^17 -5143*x^16 -3776*x^15 -3661*x^14 -1868*x^13 -975*x^12 -827*x^11 -517*x^10 -330*x^9 -23*x^8 +64*x^7 -3*x^6 -10*x^5 -5*x^4 -4*x^3 +5*x^2 +2*x -1):
    a:= n-> coeff(series(gf, x, n+1), x, n):
    seq(a(n), n=0..40);

Formula

G.f.: see Maple program.

A238918 Number of self-inverse permutations p on [n] where the maximal displacement of an element equals 7.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 76, 438, 1846, 6664, 22322, 71223, 221747, 685899, 2133273, 6639848, 20631028, 63857132, 196698620, 602652416, 1837237916, 5577247428, 16876196404, 50936285192, 153419520771, 461274617487, 1384650408582, 4150200289940, 12421725164955
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 07 2014

Keywords

Examples

			a(8) = 76: 82345671, 82345761, 82346571, 82347651, ..., 87543621, 87563421, 87645321, 87654321.
		

Crossrefs

Column k=7 of A238889.

A238919 Number of self-inverse permutations p on [n] where the maximal displacement of an element equals 8.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 1452, 6494, 25286, 90304, 307450, 1014007, 3287295, 10616111, 34460913, 112044376, 364112828, 1180542604, 3814897196, 12278519104, 39353932208, 125637022720, 399749617604, 1268585240868, 4017417046988, 12700795616136
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 07 2014

Keywords

Examples

			a(9) = 232: 923456781, 923456871, 923457681, 923458761, ..., 987456321, 987465321, 987546321, 987654321.
		

Crossrefs

Column k=8 of A238889.

A238920 Number of self-inverse permutations p on [n] where the maximal displacement of an element equals 9.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 764, 5008, 23980, 98846, 375950, 1353992, 4719178, 16089515, 54175927, 182019983, 614507621, 2078949960, 7035318948, 23778288812, 80187314884, 269618757792, 903570999504, 3017802963584, 10047020559840, 33357290774560
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 07 2014

Keywords

Crossrefs

Column k=9 of A238889.

A238921 Number of self-inverse permutations p on [n] where the maximal displacement of an element equals 10.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2620, 18228, 91600, 400300, 1604246, 6098862, 22340672, 79928946, 281441131, 981869555, 3421660163, 11978105085, 42029994744, 147596654412, 518045934492, 1815662189788, 6350004678048, 22151452791824, 77058178272192
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 07 2014

Keywords

Crossrefs

Column k=10 of A238889.
Showing 1-10 of 10 results.