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.

A231797 Number of endofunctions on [n] such that no element has a preimage of cardinality one.

Original entry on oeis.org

1, 0, 2, 3, 40, 205, 2556, 24409, 347712, 4794633, 81163900, 1434596581, 28725779952, 612610306477, 14280306222924, 354958921699425, 9471543095892736, 268347925179992593, 8075532017006497404, 256672899448317943453, 8603440900030816095600
Offset: 0

Views

Author

Alois P. Heinz, Nov 13 2013

Keywords

Examples

			a(2) = 2: (1,1), (2,2).
a(3) = 3: (1,1,1), (2,2,2), (3,3,3).
		

Crossrefs

Column k=0 of A206823.
A diagonal of A241580. Cf. also A241581.
Column k=1 of A245405.
Cf. A245496.

Programs

  • Maple
    with(combinat):
    b:= proc(t, i, u) option remember; `if`(t=0, 1,
          `if`(i<2, 0, b(t, i-1, u) +add(multinomial(t, t-i*j, i$j)
          *b(t-i*j, i-1, u-j)*u!/(u-j)!/j!, j=1..t/i)))
        end:
    a:= n-> b(n$3):
    seq(a(n), n=0..25);
  • Mathematica
    multinomial[n_, k_List] := n!/Times @@ (k!); b[t_, i_, u_] := b[t, i, u] = If[t == 0, 1, If[i < 2, 0, b[t, i - 1, u] + Sum[multinomial[t, Join[{ t - i*j}, Array[i &, j]]] * b[t - i*j, i - 1, u - j]*u!/(u - j)!/j!, {j, 1, t/i}]]]; a[n_] := b[n, n, n]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Dec 27 2013, translated from Maple *)
    Table[n!*SeriesCoefficient[(E^x-x)^n,{x,0,n}],{n,0,20}] (* Vaclav Kotesovec, Jul 23 2014 *)
    Flatten[{1,Table[(-1)^n*n! + Sum[Binomial[n,j]^2*(-1)^j*(n-j)^(n-j)*j!,{j,0,n-1}],{n,1,20}]}] (* Vaclav Kotesovec, Jul 25 2014 *)
  • PARI
    {a(n) = n! * polcoeff((exp(x + x*O(x^n)) - x)^n, n)}
    for(n=0, 30, print1(a(n), ", ")) \\ Vaclav Kotesovec, Jan 30 2015

Formula

a(n) = n! * [x^n] (exp(x)-x)^n.
a(n) ~ (1-exp(-1))^(n+1/2) * n^n. - Vaclav Kotesovec, Jul 23 2014
E.g.f.: 1 / ((1 + x) * (1 + LambertW(-x/(1 + x)))). - Ilya Gutkovskiy, Jan 25 2020
a(n) = Sum_{k=0..n} (-1)^(n-k)*(n-k)!*k^k*binomial(n,k)^2. - Ridouane Oudra, Jul 14 2025

A245687 Number T(n,k) of endofunctions on [n] such that the minimal cardinality of the nonempty preimages equals k; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 2, 2, 0, 24, 0, 3, 0, 216, 36, 0, 4, 0, 2920, 200, 0, 0, 5, 0, 44100, 2250, 300, 0, 0, 6, 0, 799134, 22932, 1470, 0, 0, 0, 7, 0, 16429504, 342608, 3136, 1960, 0, 0, 0, 8, 0, 382625856, 4638384, 147168, 9072, 0, 0, 0, 0, 9, 0, 9918836100, 79610850, 1522800, 18900, 11340, 0, 0, 0, 0, 10
Offset: 0

Views

Author

Alois P. Heinz, Jul 29 2014

Keywords

Comments

T(0,0) = 1 by convention.

Examples

			Triangle T(n,k) begins:
  1;
  0,        1;
  0,        2,      2;
  0,       24,      0,    3;
  0,      216,     36,    0,    4;
  0,     2920,    200,    0,    0,  5;
  0,    44100,   2250,  300,    0,  0,  6;
  0,   799134,  22932, 1470,    0,  0,  0,  7;
  0, 16429504, 342608, 3136, 1960,  0,  0,  0,  8;
  ...
		

Crossrefs

T(n,1) = n*A241581(n) for n>0.
Rows sums give A000312.
Main diagonal gives A028310.
T(2n,n) gives A273325.
Cf. A019575 (the same for maximal cardinality).

Programs

  • Maple
    b:= proc(n, i, k) option remember; `if`(n=0, 1, `if`(i<1, 0,
          b(n, i-1, k) +add(b(n-j, i-1, k)/j!, j=k..n)))
        end:
    T:= (n, k)-> `if`(k=0, `if`(n=0, 1, 0), `if`(k=n, n,
        `if`(k>=(n+1)/2, 0, n!*(b(n$2, k)-b(n$2, k+1))))):
    seq(seq(T(n, k), k=0..n), n=0..12);
  • Mathematica
    b[n_, i_, k_] := b[n, i, k] = If[n == 0, 1, If[i<1, 0, b[n, i-1, k] + Sum[b[n-j, i-1, k]/j!, {j, k, n}]]]; T[n_, k_] := If[k == 0, If[n == 0, 1, 0], If[k == n, n, If[k >= (n+1)/2, 0, n!*(b[n, n, k] - b[n, n, k+1])]]]; Table[Table[T[n, k], {k, 0, n}], {n, 0, 12}] // Flatten (* Jean-François Alcover, Feb 02 2015, after Alois P. Heinz *)

A241580 Triangle read by rows: T(n,k) (1 <= k <= n) defined by T(n,n) = (n-1)^(n-1), T(n,k) = T(n,k+1) - (n-1)*T(n-1,k) for k = n-1 .. 1.

Original entry on oeis.org

1, 0, 1, 2, 2, 4, 3, 9, 15, 27, 40, 52, 88, 148, 256, 205, 405, 665, 1105, 1845, 3125, 2556, 3786, 6216, 10206, 16836, 27906, 46656, 24409, 42301, 68803, 112315, 183757, 301609, 496951, 823543, 347712, 542984, 881392, 1431816, 2330336, 3800392, 6213264, 10188872, 16777216
Offset: 1

Views

Author

N. J. A. Sloane, Apr 29 2014

Keywords

Comments

Arises in analysis of game with n players: each person picks a number from 1 to n, and the winner is the largest unique choice (see Guy's letter). T(n,k) is the number out of all possible games (i.e., all n^n sets of choices) which are won by a given player who has chosen k.

Examples

			Triangle begins:
      1;
      0,     1;
      2,     2,     4;
      3,     9,    15,     27;
     40,    52,    88,    148,    256;
    205,   405,   665,   1105,   1845,   3125;
   2556,  3786,  6216,  10206,  16836,  27906,  46656;
  24409, 42301, 68803, 112315, 183757, 301609, 496951, 823543;
  ...
		

Crossrefs

T(n,0) is A231797, row sums are A241581.

Programs

  • Maple
    M:=20;
    M2:=10;
    T[1,1]:=1:
    for n from 2 to M do
       T[n,n]:=(n-1)^(n-1);
       for k from n-1 by -1 to 1 do
          T[n,k]:=T[n,k+1]-(n-1)*T[n-1,k]:
    od:
    od:
    for n from 1 to M2 do lprint([seq(T[n,k],k=1..n)]); od:
Showing 1-3 of 3 results.