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

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

Original entry on oeis.org

1, 1, 0, 1, 2, 0, 2, 1, 0, 1, 6, 0, 6, 3, 2, 3, 2, 1, 0, 1, 24, 0, 24, 12, 8, 18, 8, 10, 3, 6, 3, 2, 1, 0, 1, 120, 0, 120, 60, 40, 90, 64, 50, 39, 42, 23, 28, 13, 10, 8, 6, 3, 2, 1, 0, 1, 720, 0, 720, 360, 240, 540, 384, 420, 234, 372, 198, 208, 168, 124, 98, 75, 60, 35, 34, 13, 16, 8, 6, 3
Offset: 1

Views

Author

Emeric Deutsch, Sep 21 2008

Keywords

Comments

Row n contains n*(n+1)/2 = A000217(n) entries.
Sum of entries in row n = n! = A000142(n).

Examples

			T(4,6)=3 because we have 1243, 1342 and 2341 with left-to-right maxima at positions 1,2,3.
Triangle starts:
   1;
   1,  0,  1;
   2,  0,  2,  1,  0,  1;
   6,  0,  6,  3,  2,  3,  2,  1,  0,  1;
  24,  0, 24, 12,  8, 18,  8, 10,  3,  6,  3,  2,  1,  0,  1;
  ...
		

Crossrefs

T(n,n) gives A368246.

Programs

  • Maple
    P:=proc(n) options operator, arrow: sort(expand(product(t^j+j-1,j=1..n))) 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
    # second Maple program:
    b:= proc(n) option remember; `if`(n=0, 1,
          expand(b(n-1)*(x^n+n-1)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..degree(p)))(b(n)):
    seq(T(n), n=1..7);  # Alois P. Heinz, Aug 05 2020
  • Mathematica
    row[n_] := CoefficientList[Product[t^k + k - 1, {k, 1, n}], t] // Rest;
    Array[row, 7] // Flatten (* Jean-François Alcover, Nov 28 2017 *)

Formula

T(n,1) = T(n,3) = (n-1)! for n>=2.
Sum_{k=1..n*(n+1)/2} k * T(n,k) = n! * n = A001563(n).
Generating polynomial of row n is t(t^2+1)(t^3+2)...(t^n+n-1).
Sum_{k=1..n*(n+1)/2} (n*(n+1)/2-k) * T(n,k) = A001804(n). - Alois P. Heinz, Dec 19 2023

A368678 Number of permutations of [n] whose cycle maxima sum to 2n.

Original entry on oeis.org

1, 0, 0, 1, 2, 10, 41, 260, 1552, 12818, 101280, 1021908, 10154064, 121656672, 1447205472, 20215013184, 280271024640, 4457067906240, 70826580095040, 1264147627392000, 22588177271650560, 448332829478760960, 8899910723677639680, 194096853444946636800
Offset: 0

Views

Author

Alois P. Heinz, Jan 02 2024

Keywords

Examples

			a(0) = 1: the empty permutation.
a(3) = 1: (1)(2)(3).
a(4) = 2: (1)(23)(4), (1)(24)(3).
a(5) = 10: (12)(3)(45), (13)(2)(45), (1)(234)(5), (1)(243)(5), (1)(235)(4),
  (1)(253)(4), (145)(2)(3), (154)(2)(3), (1)(24)(35), (1)(25)(34).
		

Crossrefs

Programs

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

Formula

a(n) = A143947(n,2n).

A368204 Number of partitions of [n] whose block minima sum to n.

Original entry on oeis.org

1, 1, 0, 2, 2, 2, 29, 56, 191, 380, 5097, 14288, 74359, 283884, 1106529, 13588409, 53640963, 350573155, 1867738775, 10770352150, 50050737949, 744605446778, 3615378756421, 29368052533243, 195027586980839, 1442227919200245, 8964685271444243, 61478734886319324
Offset: 0

Views

Author

Alois P. Heinz, Dec 16 2023

Keywords

Examples

			a(0) = 1: the empty partition.
a(1) = 1: 1.
a(2) = 0.
a(3) = 2: 13|2, 1|23.
a(4) = 2: 124|3, 12|34.
a(5) = 2: 1235|4, 123|45.
a(6) = 29: 12346|5, 1234|56, 1456|2|3, 145|26|3, 145|2|36, 146|25|3, 14|256|3, 14|25|36, 146|2|35, 14|26|35, 14|2|356, 156|24|3, 15|246|3, 15|24|36, 16|245|3, 1|2456|3, 1|245|36, 16|24|35, 1|246|35, 1|24|356, 156|2|34, 15|26|34, 15|2|346, 16|25|34, 1|256|34, 1|25|346, 16|2|345, 1|26|345, 1|2|3456.
		

Crossrefs

Main diagonal of A124327.

Programs

  • Maple
    b:= proc(n, i, t, m) option remember; `if`(n=0, t^(m-i+1),
         `if`((i+m)*(m+1-i)/2n, 0, `if`(t=0, 0,
          t*b(n, i+1, t, m))+ b(n-i, i+1, t+1, m)))
        end:
    a:= n-> b(n, 1, 0, n):
    seq(a(n), n=0..42);
  • Mathematica
    b[n_, i_, t_, m_] := b[n, i, t, m] = If[n == 0, t^(m - i + 1),
       If[(i + m)*(m + 1 - i)/2 < n || i > n, 0, If[t == 0, 0,
       t*b[n, i + 1, t, m]] + b[n - i, i + 1, t + 1, m]]];
    a[n_] := If[n == 0, 1, b[n, 1, 0, n]];
    Table[a[n], {n, 0, 42}] (* Jean-François Alcover, Jun 10 2024, after Alois P. Heinz *)

Formula

a(n) = A124327(n,n).
Showing 1-3 of 3 results.