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

A238889 Number T(n,k) of self-inverse permutations p on [n] where the maximal displacement of an element equals k: k = max_{i=1..n} |p(i)-i|; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 4, 3, 2, 0, 1, 7, 7, 7, 4, 0, 1, 12, 16, 19, 18, 10, 0, 1, 20, 35, 47, 55, 48, 26, 0, 1, 33, 74, 117, 151, 170, 142, 76, 0, 1, 54, 153, 284, 399, 515, 544, 438, 232, 0, 1, 88, 312, 675, 1061, 1471, 1826, 1846, 1452, 764, 0, 1, 143, 629, 1575, 2792, 4119, 5651, 6664, 6494, 5008, 2620, 0
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 06 2014

Keywords

Comments

Main diagonal and lower diagonal give: A000007, A000085(n-1).
Row sums give A000085.

Examples

			T(4,0) = 1: 1234.
T(4,1) = 4: 1243, 1324, 2134, 2143.
T(4,2) = 3: 1432, 3214, 3412.
T(4,3) = 2: 4231, 4321.
Triangle T(n,k) begins:
00: 1;
01: 1,   0;
02: 1,   1,   0;
03: 1,   2,   1,   0;
04: 1,   4,   3,   2,    0;
05: 1,   7,   7,   7,    4,    0;
06: 1,  12,  16,  19,   18,   10,    0;
07: 1,  20,  35,  47,   55,   48,   26,    0;
08: 1,  33,  74, 117,  151,  170,  142,   76,    0;
09: 1,  54, 153, 284,  399,  515,  544,  438,  232,   0;
10: 1,  88, 312, 675, 1061, 1471, 1826, 1846, 1452, 764,  0;
...
The 26 involutions of 5 elements together with their maximal displacements are:
01:  [ 1 2 3 4 5 ]   0
02:  [ 1 2 3 5 4 ]   1
03:  [ 1 2 4 3 5 ]   1
04:  [ 1 2 5 4 3 ]   2
05:  [ 1 3 2 4 5 ]   1
06:  [ 1 3 2 5 4 ]   1
07:  [ 1 4 3 2 5 ]   2
08:  [ 1 4 5 2 3 ]   2
09:  [ 1 5 3 4 2 ]   3
10:  [ 1 5 4 3 2 ]   3
11:  [ 2 1 3 4 5 ]   1
12:  [ 2 1 3 5 4 ]   1
13:  [ 2 1 4 3 5 ]   1
14:  [ 2 1 5 4 3 ]   2
15:  [ 3 2 1 4 5 ]   2
16:  [ 3 2 1 5 4 ]   2
17:  [ 3 4 1 2 5 ]   2
18:  [ 3 5 1 4 2 ]   3
19:  [ 4 2 3 1 5 ]   3
20:  [ 4 2 5 1 3 ]   3
21:  [ 4 3 2 1 5 ]   3
22:  [ 4 5 3 1 2 ]   3
23:  [ 5 2 3 4 1 ]   4
24:  [ 5 2 4 3 1 ]   4
25:  [ 5 3 2 4 1 ]   4
26:  [ 5 4 3 2 1 ]   4
There is one involution with no displacements, 7 with one displacement, etc. giving row 4: [1, 7, 7, 7, 4, 0].
		

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<0, 0, b(n, k, {})):
    T:= (n, k)-> A(n, k) -A(n, k-1):
    seq(seq(T(n, k), k=0..n), n=0..14);
  • Mathematica
    b[n_, k_, s_List] := 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<0, 0, b[n, k, {}]]; T[n_, k_] := A[n, k] - A[n, k-1]; Table[Table[T[n, k], {k, 0, n}], {n, 0, 14}] // Flatten (* Jean-François Alcover, Jan 08 2015, translated from Maple *)

Formula

T(n,k) = A238888(n,k) - A238888(n,k-1) for k>0, T(n,0) = 1.

A239075 Number of self-inverse permutations p on [n] with displacement of elements restricted by 3: |p(i)-i| <= 3.

Original entry on oeis.org

1, 1, 2, 4, 10, 22, 48, 103, 225, 492, 1076, 2348, 5124, 11184, 24417, 53305, 116366, 254024, 554534, 1210554, 2642656, 5768943, 12593649, 27492040, 60015368, 131014088, 286004920, 624351264, 1362964321, 2975363169, 6495244138, 14179175436, 30953265426
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 10 2014

Keywords

Comments

Column k=3 of A238888.
Also the number of compositions of n into m sorts of k's, where m=1 if k=1,2,3, m=2 if k>6 and m=3 if k=4,5,6. - Beimar Naranjo, Mar 05 2024

Crossrefs

Programs

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

Formula

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

A239076 Number of self-inverse permutations p on [n] with displacement of elements restricted by 4: |p(i)-i| <= 4.

Original entry on oeis.org

1, 1, 2, 4, 10, 26, 66, 158, 376, 891, 2137, 5140, 12376, 29756, 71468, 171596, 412084, 989800, 2377717, 5711705, 13720054, 32955996, 79161006, 190147558, 456743814, 1097123162, 2635347280, 6330234855, 15205529809, 36524416280, 87733426944, 210739993784
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 10 2014

Keywords

Comments

Column k=4 of A238888.

Crossrefs

Programs

  • Maple
    gf:= -(x+1)*(x^7 -x^6+2*x^5 -x^4 +x^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 + 1) (x^7 - x^6 + 2 x^5 - x^4 + x^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, 50}], x] (* Vincenzo Librandi, Mar 12 2014 *)

Formula

G.f.: -(x+1)*(x^7 -x^6+2*x^5 -x^4 +x^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).

A239077 Number of self-inverse permutations p on [n] with displacement of elements restricted by 5: |p(i)-i| <= 5.

Original entry on oeis.org

1, 1, 2, 4, 10, 26, 76, 206, 546, 1406, 3608, 9259, 23981, 62324, 162224, 422028, 1096900, 2848240, 7394076, 19196044, 49844356, 129443736, 336182997, 873106045, 2267493182, 5888625652, 15292437454, 39713590230, 103134439084, 267836774530, 695564961926
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 10 2014

Keywords

Comments

Column k=5 of A238888.

Crossrefs

Programs

  • Maple
    gf:= -(x^22 +2*x^17 -10*x^12 -2*x^11 +2*x^10 -2*x^9 -2*x^8 +6*x^7 +4*x^6 -2*x^5 +2*x^4 +2*x^3 +2*x^2-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^22 + 2 x^17 - 10 x^12 - 2 x^11 + 2 x^10 - 2 x^9 - 2 x^8 + 6 x^7 + 4 x^6 - 2 x^5 + 2 x^4 + 2 x^3 + 2 x^2 - 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, 50}], x] (* Vincenzo Librandi, Mar 12 2014 *)

Formula

G.f.: -(x^22 +2*x^17 -10*x^12 -2*x^11 +2*x^10 -2*x^9 -2*x^8 +6*x^7 +4*x^6 -2*x^5 +2*x^4 +2*x^3 +2*x^2-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).

A239078 Number of self-inverse permutations p on [n] with displacement of elements restricted by 6: |p(i)-i| <= 6.

Original entry on oeis.org

1, 1, 2, 4, 10, 26, 76, 232, 688, 1950, 5434, 14910, 40840, 112063, 309829, 859684, 2389776, 6643900, 18460796, 51248304, 142167544, 394279264, 1093484420, 3033005340, 8413870972, 23343324312, 64766314089, 179693948237, 498548997886, 1383158961636
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 10 2014

Keywords

Crossrefs

Column k=6 of A238888.
Cf. A000085.

Programs

  • Maple
    gf:= -(x^52 +2*x^50 -2*x^49 -6*x^47 +2*x^46 -2*x^45 +8*x^44 +4*x^43 -4*x^41 -34*x^40 +4*x^39 -38*x^38 +48*x^37 +20*x^36 +90*x^35 -36*x^34 +16*x^33 -108*x^32 +2*x^31 +10*x^30 +126*x^29 +166*x^28 +16*x^27 +168*x^26 -48*x^25 -34*x^24 -134*x^23 +32*x^22 -74*x^21 -50*x^20 +90*x^19 -40*x^18 -60*x^17 -120*x^16 -44*x^15 -86*x^14 -52*x^13 +30*x^12 +24*x^11 +44*x^10 +14*x^9 +44*x^8 +24*x^7 -4*x^6 +6*x^5 +6*x^4 +2*x^3 +2*x^2-1) /
    (x^64 +x^63 +3*x^62 -x^61 -x^60 -5*x^59 -5*x^58 -13*x^57 +x^56 -3*x^55 +15*x^54 +17*x^53 +15*x^52 -26*x^51 -82*x^50 -18*x^49 -14*x^48 +146*x^47 +170*x^46 +390*x^45 -102*x^44 +10*x^43 -374*x^42 -394*x^41 -178*x^40 +434*x^39 +800*x^38 +208*x^37 -284*x^36 -1024*x^35 -1016*x^34 -1080*x^33
    +916*x^32 -1264*x^31 -1068*x^30 -1212*x^29 -1644*x^28 -560*x^27 -2080*x^26 -614*x^25 -350*x^24 +434*x^23 +510*x^22 +270*x^21 +230*x^20 -294*x^19 +438*x^18 +694*x^17 +806*x^16 +602*x^15 +578*x^14 +494*x^13 +111*x^12 -81*x^11 -183*x^10 -95*x^9 -119*x^8 -67*x^7 +x^6 -3*x^5 -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);

Formula

See Maple program.

A239079 Number of self-inverse permutations p on [n] with displacement of elements restricted by 7: |p(i)-i| <= 7.

Original entry on oeis.org

1, 1, 2, 4, 10, 26, 76, 232, 764, 2388, 7280, 21574, 63162, 183286, 531576, 1545583, 4523049, 13283748, 39091824, 115105436, 338866164, 996931680, 2930722336, 8610252768, 25290067376, 74279609504, 218185834860, 640968565724, 1883199406468, 5533359251576
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 10 2014

Keywords

Crossrefs

Column k=7 of A238888.
Cf. A000085.

A239080 Number of self-inverse permutations p on [n] with displacement of elements restricted by 8: |p(i)-i| <= 8.

Original entry on oeis.org

1, 1, 2, 4, 10, 26, 76, 232, 764, 2620, 8732, 28068, 88448, 273590, 839026, 2559590, 7810344, 23899859, 73552737, 227149812, 702978992, 2177474284, 6745619532, 20888771872, 64643999584, 199916632224, 617935452464, 1909553806592, 5900616453456, 18234154867712
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 10 2014

Keywords

Crossrefs

Column k=8 of A238888.
Cf. A000085.

A239081 Number of self-inverse permutations p on [n] with displacement of elements restricted by 9: |p(i)-i| <= 9.

Original entry on oeis.org

1, 1, 2, 4, 10, 26, 76, 232, 764, 2620, 9496, 33076, 112428, 372436, 1214976, 3913582, 12529522, 39989374, 127728664, 409169795, 1317486613, 4256424244, 13780938480, 44667060684, 144831314468, 469535390016, 1521506451968, 4927356770176, 15947637013296
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 10 2014

Keywords

Crossrefs

Column k=9 of A238888.
Cf. A000085.

A239082 Number of self-inverse permutations p on [n] with displacement of elements restricted by 10: |p(i)-i| <= 10.

Original entry on oeis.org

1, 1, 2, 4, 10, 26, 76, 232, 764, 2620, 9496, 35696, 130656, 464036, 1615276, 5517828, 18628384, 62330046, 207657610, 690610926, 2299356168, 7678084407, 25759043565, 86697055428, 292427968880, 987581324508, 3337168641756, 11277361448224, 38099089805120
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 10 2014

Keywords

Crossrefs

Column k=10 of A238888.
Cf. A000085.
Showing 1-9 of 9 results.