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.

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