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.

A369596 Number T(n,k) of permutations of [n] whose fixed points sum to k; triangle T(n,k), n>=0, 0<=k<=A000217(n), read by rows.

Original entry on oeis.org

1, 0, 1, 1, 0, 0, 1, 2, 1, 1, 1, 0, 0, 1, 9, 2, 2, 3, 3, 2, 1, 1, 0, 0, 1, 44, 9, 9, 11, 11, 13, 5, 5, 4, 4, 2, 1, 1, 0, 0, 1, 265, 44, 44, 53, 53, 62, 64, 29, 22, 24, 16, 16, 8, 6, 5, 4, 2, 1, 1, 0, 0, 1, 1854, 265, 265, 309, 309, 353, 362, 406, 150, 159, 126, 126, 93, 86, 44, 36, 29, 19, 19, 9, 7, 5, 4, 2, 1, 1, 0, 0, 1
Offset: 0

Views

Author

Alois P. Heinz, Mar 02 2024

Keywords

Examples

			T(3,0) = 2: 231, 312.
T(3,1) = 1: 132.
T(3,2) = 1: 321.
T(3,3) = 1: 213.
T(3,6) = 1: 123.
T(4,0) = 9: 2143, 2341, 2413, 3142, 3412, 3421, 4123, 4312, 4321.
Triangle T(n,k) begins:
   1;
   0, 1;
   1, 0, 0,  1;
   2, 1, 1,  1,  0,  0, 1;
   9, 2, 2,  3,  3,  2, 1, 1, 0, 0, 1;
  44, 9, 9, 11, 11, 13, 5, 5, 4, 4, 2, 1, 1, 0, 0, 1;
  ...
		

Crossrefs

Column k=0 gives A000166.
Column k=3 gives A000255(n-2) for n>=2.
Row sums give A000142.
Row lengths give A000124.
Reversed rows converge to A331518.
T(n,n) gives A369796.

Programs

  • Maple
    b:= proc(s) option remember; (n-> `if`(n=0, 1, add(expand(
          `if`(j=n, x^j, 1)*b(s minus {j})), j=s)))(nops(s))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b({$1..n})):
    seq(T(n), n=0..7);
    # second Maple program:
    g:= proc(n) option remember; `if`(n=0, 1, n*g(n-1)+(-1)^n) end:
    b:= proc(n, i, m) option remember; `if`(n>i*(i+1)/2, 0,
         `if`(n=0, g(m), b(n, i-1, m)+b(n-i, min(n-i, i-1), m-1)))
        end:
    T:= (n, k)-> b(k, min(n, k), n):
    seq(seq(T(n, k), k=0..n*(n+1)/2), n=0..7);
  • Mathematica
    g[n_] := g[n] = If[n == 0, 1, n*g[n - 1] + (-1)^n];
    b[n_, i_, m_] := b[n, i, m] = If[n > i*(i + 1)/2, 0,
       If[n == 0, g[m], b[n, i-1, m] + b[n-i, Min[n-i, i-1], m-1]]];
    T[n_, k_] := b[k, Min[n, k], n];
    Table[Table[T[n, k], {k, 0, n*(n + 1)/2}], {n, 0, 7}] // Flatten (* Jean-François Alcover, May 24 2024, after Alois P. Heinz *)

Formula

Sum_{k=0..A000217(n)} k * T(n,k) = A001710(n+1) for n >= 1.
Sum_{k=0..A000217(n)} (1+k) * T(n,k) = A038720(n) for n >= 1.
Sum_{k=0..A000217(n)} (n*(n+1)/2-k) * T(n,k) = A317527(n+1).
T(n,A161680(n)) = A331518(n).
T(n,A000217(n)) = 1.

A367850 Total sum of the block maxima minus the block minima over all partitions of [n].

Original entry on oeis.org

0, 0, 1, 6, 33, 182, 1034, 6122, 37927, 246030, 1669941, 11844324, 87644672, 675494180, 5413500801, 45040155758, 388441330457, 3467619369538, 31998729152474, 304846692965822, 2994781617653439, 30304301968015582, 315536869771786501, 3377398077726963112
Offset: 0

Views

Author

Alois P. Heinz, Dec 15 2023

Keywords

Examples

			a(3) = 6 = 2 + 1 + 2 + 1 + 0: 123, 12|3, 13|2, 1|23, 1|2|3.
		

Crossrefs

Cf. A000110, A002538 (the same for permutations), A002620, A120325, A124325, A278677, A368338.

Programs

  • Maple
    b:= proc(n, m, t) option remember; `if`(n=0, [1, 0], (p->
          p+[0, p[1]*(n-t)])(b(n-1, m+1, t+1))+m*b(n-1, m, t+1))
        end:
    a:= n-> b(n, 0, 1)[2]:
    seq(a(n), n=0..23);
    # second Maple program:
    egf:= (z-2)*exp(2*z+exp(z)-1)+(2*z+1)*exp(z+exp(z)-1)+exp(exp(z)-1):
    a:= n-> n!*coeff(series(egf, z, n+1), z, n):
    seq(a(n), n=0..23);

Formula

E.g.f.: (z-2)*exp(2*z+exp(z)-1)+(2*z+1)*exp(z+exp(z)-1)+exp(exp(z)-1).
a(n) = A278677(n-1) - A124325(n+1) for n>=1.
a(n) = Bell(n+1)+(n+1)*Bell(n)-Bell(n+2)+Sum_{k=0..n} Stirling2(n+1,k)*(n+1-k).
a(n) = Sum_{k=0..A002620(n)} k * A368338(n,k).
a(n) mod 2 = A120325(n).

A368401 Number T(n,k) of permutations of [n] whose sum of cycle maxima minus cycle minima gives k, triangle T(n,k), n>=0, 0<=k<=A002620(n), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 3, 1, 3, 7, 11, 2, 1, 4, 12, 28, 53, 12, 10, 1, 5, 18, 52, 135, 289, 84, 72, 58, 6, 1, 6, 25, 84, 257, 734, 1825, 524, 564, 496, 422, 60, 42, 1, 7, 33, 125, 429, 1407, 4545, 12983, 3520, 3976, 4292, 3950, 3422, 790, 486, 330, 24
Offset: 0

Views

Author

Alois P. Heinz, Dec 22 2023

Keywords

Examples

			T(3,0) = 1: (1)(2)(3).
T(3,1) = 2: (12)(3), (1)(23).
T(3,2) = 3: (123), (132), (13)(2).
Triangle T(n,k) begins:
  1;
  1;
  1, 1;
  1, 2,  3;
  1, 3,  7, 11,   2;
  1, 4, 12, 28,  53,  12,   10;
  1, 5, 18, 52, 135, 289,   84,  72,  58,   6;
  1, 6, 25, 84, 257, 734, 1825, 524, 564, 496, 422, 60, 42;
  ...
		

Crossrefs

Programs

  • Maple
    b:= proc(n, s) option remember; `if`(n=0, 1, (k-> `if`(n>k,
          b(n-1, s)+add(b(n-1, subs(h=h+[0, 1], s)), h=s), 0)+
          `if`(n>k+1, b(n-1, {s[], [n,1]}), 0)+add(h[2]!*expand(
          x^(h[1]-n)*b(n-1, s minus {h})), h=s))(nops(s)))
        end:
    T:= (n, k)-> coeff(b(n, {}), x, k):
    seq(seq(T(n, k), k=0..floor(n^2/4)), n=0..10);

Formula

Sum_{k=0..A002620(n)} k * T(n,k) = A002538(n-1) for n >= 1.

A367450 Number of partitions of [n] whose sum of block maxima equals twice the sum of block minima.

Original entry on oeis.org

1, 0, 1, 0, 1, 4, 12, 55, 198, 979, 4700, 22288, 131612, 754614, 4833776, 32539094, 225628769, 1675660796, 12676652631, 100996809180, 830086817650, 7065404491242
Offset: 0

Views

Author

Alois P. Heinz, Dec 15 2023

Keywords

Examples

			a(0) = 1: the empty partition.
a(2) = 1: 12.
a(4) = 1: 134|2.
a(5) = 4: 1245|3, 1|2345, 14|25|3, 15|24|3.
a(6) = 12: 12356|4, 12|3456, 13|25|46, 13|26|45, 15|23|46, 16|23|45, 14|2|356, 1|245|36, 1|246|35, 156|2|34, 1|25|346, 1|26|345.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, m, s) option remember;
         `if`(n=0, `if`(add(i, i=m)*2=s, 1, 0),
          add(b(n-1, subs(j=n, m), s), j=m)+
              b(n-1, {m[], n}, s+n))
        end:
    a:= n-> b(n, {}, 0):
    seq(a(n), n=0..15);
Showing 1-4 of 4 results.