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.

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.

A331517 a(n) = Sum_{k=0..n} p(n,k) * !k, where p(n,k) = number of partitions of n into k parts and !k = subfactorial of k.

Original entry on oeis.org

1, 0, 1, 3, 13, 59, 336, 2245, 17408, 153124, 1505420, 16342711, 194060616, 2501178199, 34766184181, 518332353130, 8250146291076, 139618375340912, 2503167665128431, 47393482639721484, 944910760664087791, 19787603213440946946, 434229133448518143203
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 19 2020

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[Length[IntegerPartitions[n, {k}]] Subfactorial[k], {k, 0, n}], {n, 0, 22}]
    nmax = 22; CoefficientList[Series[Sum[Subfactorial[k] x^k/Product[(1 - x^j), {j, 1, k}], {k, 0, nmax}], {x, 0, nmax}], x]

Formula

G.f.: Sum_{k>=0} !k * x^k / Product_{j=1..k} (1 - x^j).
a(n) ~ exp(-1) * n! * (1 + 1/n + 2/n^2 + 5/n^3 + 16/n^4 + 60/n^5 + 253/n^6 + 1180/n^7 + 6023/n^8 + 33306/n^9 + 197719/n^10 + ...), for coefficients see A331826. - Vaclav Kotesovec, Jan 28 2020

A369796 Number of permutations of [n] whose fixed points sum to n.

Original entry on oeis.org

1, 1, 0, 1, 3, 13, 64, 406, 2737, 23044, 200509, 2078460, 22323513, 275402437, 3501602483, 50310672046, 739235942264, 12084285146335, 202054808987101, 3703410393626031, 69269248667062892, 1409725495837854024, 29169764518508360709, 651568557906956269430
Offset: 0

Views

Author

Alois P. Heinz, Mar 02 2024

Keywords

Examples

			a(0) = 1: the empty permutation.
a(1) = 1: 1.
a(3) = 1: 213.
a(4) = 3: 1432, 2314, 3124.
a(5) = 13: 13542, 15243, 21435, 23415, 24135, 31425, 34125, 34215, 41235, 42351, 43125, 43215, 52314.
a(6) = 64: 123564, 123645, 132654, 134652, 136254, ..., 542136, 542316, 621435, 625413, 625431.
		

Crossrefs

Main diagonal of A369596.

Programs

  • Maple
    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:
    a:= n-> b(n$3):
    seq(a(n), n=0..23);

Formula

a(n) = Sum_{k>=0} A000166(n-k)*A008289(n,k).
a(n) = A369596(n,n).
Showing 1-3 of 3 results.