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.

A143947 Triangle read by rows: T(n,k) is the number of permutations of [n] for which the sum of the positions of the right-to-left minima is k (1 <= k <= n*(n+1)/2).

Original entry on oeis.org

1, 0, 1, 1, 0, 0, 2, 1, 2, 1, 0, 0, 0, 6, 2, 3, 7, 2, 3, 1, 0, 0, 0, 0, 24, 6, 8, 14, 27, 10, 9, 14, 3, 4, 1, 0, 0, 0, 0, 0, 120, 24, 30, 46, 68, 142, 41, 53, 50, 73, 23, 17, 23, 4, 5, 1, 0, 0, 0, 0, 0, 0, 720, 120, 144, 204, 270, 436, 834, 260, 256, 351, 310, 463, 148, 145, 118, 148, 40
Offset: 1

Views

Author

Emeric Deutsch, Sep 22 2008

Keywords

Comments

Row n contains n(n+1)/2 entries, first n-1 of which are 0. Sum of entries in row n = n! = A000142(n).
Sum of entries in column n = A143948(n).
T(n,n) = (n-1)!.
Sum_{k=n..n(n+1)/2} k*T(n,k) = A001705(n).

Examples

			T(4,6) = 3 because we have 4132, 3142 and 2143 with right-to-left minima at positions 2 and 4.
Triangle starts:
  1;
  0,  1,  1;
  0,  0,  2,  1,  2,  1;
  0,  0,  0,  6,  2,  3,  7,  2,  3,  1;
  0,  0,  0,  0, 24,  6,  8, 14, 27, 10,  9, 14,  3,  4,  1;
  ...
		

Crossrefs

T(n,2n) gives A368678.
Row maxima give A367594.

Programs

  • Maple
    P:=proc(n) options operator, arrow: sort(expand(product(t^(n-j)+j,j=0..n-1))) end proc: for n to 7 do seq(coeff(P(n),t,i),i=1..(1/2)*n*(n+1)) end do; # yields sequence in triangular form
  • Mathematica
    T[n_] := CoefficientList[Product[n-k+t^k, {k, 1, n-1}] t^(n-1), t];
    Array[T, 10] // Flatten (* Jean-François Alcover, Feb 14 2021 *)

Formula

Generating polynomial of row n is (n-1+t)(n-2+t^2)(n-3+t^3)...(1+t^(n-1))t^n.

A368246 Number of permutations of [n] whose cycle minima sum to n.

Original entry on oeis.org

1, 1, 0, 2, 3, 8, 90, 384, 2940, 18864, 232848, 1919520, 23364000, 261282240, 3486637440, 48900116160, 746747164800, 11559784320000, 201817271416320, 3580457619916800, 68121866659875840, 1366946563510886400, 28802183294533017600, 627950275273991577600
Offset: 0

Views

Author

Alois P. Heinz, Dec 18 2023

Keywords

Comments

Also the number of permutations of [n] for which the sum of the positions of the left-to-right maxima is n: a(4) = 3: 2143, 3142, 3241; a(5) = 8: 31254, 32154, 41253, 41352, 42153, 42351, 43152, 43251.

Examples

			a(0) = 1: the empty permutation.
a(1) = 1: (1).
a(2) = 0.
a(3) = 2: (13)(2), (1)(23).
a(4) = 3: (124)(3), (142)(3), (12)(34).
a(5) = 8: (1235)(4), (1253)(4), (1325)(4), (1352)(4), (1523)(4), (1532)(4), (123)(45), (132)(45).
		

Crossrefs

Main diagonal of A143946.

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, 1,
          expand(b(n-1)*(x^n+n-1)))
        end:
    a:= n-> coeff(b(n), x, n):
    seq(a(n), n=0..23);

Formula

a(n) = A143946(n,n).
a(n) ~ c * (n-1)!, where c = 0.561459..., conjecture: c = exp(-gamma) = A080130, where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Dec 29 2023

A368675 Number of partitions of [n] whose block maxima sum to 2n.

Original entry on oeis.org

1, 0, 0, 1, 2, 7, 15, 39, 81, 193, 396, 885, 1816, 3915, 7973, 16860, 34165, 71092, 143804, 295963, 596872, 1219950, 2455139, 4989265, 10028841, 20296288, 40745616, 82225558, 164916967, 332045545, 665566046, 1337794545, 2680049287, 5380396625, 10774301183
Offset: 0

Views

Author

Alois P. Heinz, Jan 02 2024

Keywords

Examples

			a(0) = 1: the empty partition.
a(3) = 1: 1|2|3.
a(4) = 2: 1|23|4, 1|24|3.
a(5) = 7: 12|3|45, 13|2|45, 1|234|5, 1|235|4, 145|2|3, 1|24|35, 1|25|34.
a(6) = 15: 12|34|56, 12|356|4, 134|2|56, 1356|2|4, 1|2345|6, 1|2346|5, 1|235|46, 1|236|45, 14|2|356, 1|245|36, 1|246|35, 156|2|34, 1|25|346, 1|26|345, 1|2|3|456.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, 1,
          b(n-1, m)*m + expand(x^n*b(n-1, m+1)))
        end:
    a:= n-> coeff(b(n, 0), x, 2*n):
    seq(a(n), n=0..42);
    # second Maple program:
    b:= proc(n, i, t) option remember; `if`(i*(i+1)/2 b(2*n, n, 0):
    seq(a(n), n=0..42);
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[i*(i + 1)/2 < n, 0, If[n == 0, t^i, If[t == 0, 0, t*b[n, i - 1, t]] + (t + 1)^Max[0, 2*i - n - 1]*b[n - i, Min[n - i, i - 1], t + 1]]];
    a[n_] := If[n == 0, 1, b[2n, n, 0]];
    Table[a[n], {n, 0, 42}] (* Jean-François Alcover, Oct 03 2024, after Alois P. Heinz *)

Formula

a(n) = A367955(n,2n).
a(n) ~ c * 2^n, where c = 0.636808431228827742738441592748953932083264824206324529619378074873607293... - Vaclav Kotesovec, Jan 13 2024

A367594 Number of permutations of [n] whose cycle maxima sum to k, where k is chosen so as to maximize this number.

Original entry on oeis.org

1, 1, 1, 2, 7, 27, 142, 834, 5962, 46788, 426708, 4198632, 46516800, 551415936, 7197404976, 99712618560, 1500173940960, 23786129681280, 405087689727360, 7237524061198080, 137652562628778240, 2735042530132523520, 57482464477451489280, 1257272784581092070400
Offset: 0

Views

Author

Alois P. Heinz, Jan 03 2024

Keywords

Examples

			a(4) = 7 = A143947(4,7): (123)(4), (132)(4), (124)(3), (142)(3), (13)(24),
  (14)(23), (1)(2)(34).
a(5) = 27 = A143947(5,9): (1234)(5), (1243)(5), (1324)(5), (1342)(5), (1423)(5), (1432)(5), (1235)(4), (1253)(4), (1325)(4), (1352)(4), (1523)(4), (1532)(4), (124)(35), (142)(35), (125)(34), (152)(34), (134)(25), (143)(25), (135)(24), (153)(24), (14)(235), (14)(253), (15)(234), (15)(243), (1)(23)(45), (1)(245)(3), (1)(254)(3).
		

Crossrefs

Row maxima of A143947.
Cf. A368678.

Programs

  • Maple
    b:= proc(n) option remember;
          `if`(n=0, 1, expand(b(n-1)*(t-n+x^n)))
        end:
    a:= n-> max(coeffs(subs(t=n, b(n)))):
    seq(a(n), n=0..23);
  • Mathematica
    a[n_] := If[n == 0, 1, Module[{t}, CoefficientList[Product[n-k+t^k, {k, 1, n-1}]*t^(n-1), t] // Max]];
    Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Oct 03 2024 *)

Formula

a(n) = A143947(n,2n-1) for n>=1, a(0) = 1.
Showing 1-4 of 4 results.