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.

A060226 a(n) = n^n - n*(n-1)^(n-1).

Original entry on oeis.org

1, 0, 2, 15, 148, 1845, 27906, 496951, 10188872, 236425545, 6125795110, 175311670611, 5492360400924, 186965800764925, 6871755333266474, 271213787997489135, 11440441827615801616, 513645612633274386705
Offset: 0

Views

Author

Henry Bottomley, Jul 12 2001

Keywords

Comments

For n > 0, a(n) = number of endofunctions of [n] mapping some x<>1 to 1. - Len Smiley, Nov 15 2001 (Endofunction interpretation from a(n) = n*(n^(n-1) - (n-1)^(n-1)).)

Crossrefs

Programs

  • Haskell
    a060226 0 = 1
    a060226 n = a000312 n - n * a000312 (n - 1)
    -- Reinhard Zumkeller, Aug 27 2012
    
  • Magma
    A060226:= func< n | n^n - n*(n-1)^(n-1) >;
    [A060226(n): n in [0..30]]; // G. C. Greubel, Nov 03 2024
    
  • Maple
    f := n-> n*sum(binomial(n-1,j-1)*(n-1)^(n-j), j=2..n);
    g := n-> n^n -n*(n-1)^(n-1);
    h := n-> sum(binomial(n,j)*j^(j-1)*(n-j)^(n-j), j=2..n);
    k := n-> sum(binomial(n,j-1)*(j-1)^(j-1)*(n-j)^(n-j), j=2..n); # then a(n)=f(n)=g(n)=h(n)=k(n)
  • Mathematica
    Join[{1,0},Table[n^n-n*(n-1)^(n-1),{n,2,20}]] (* Harvey P. Dale, Nov 16 2012 *)
  • PARI
    { for (n=0, 100, write("b060226.txt", n, " ", n^n - n*(n - 1)^(n - 1)); ) } \\ Harry J. Smith, Jul 03 2009
    
  • SageMath
    def A060226(n): return n^n - n*(n-1)^(n-1)
    [A060226(n) for n in range(31)] # G. C. Greubel, Nov 03 2024

Formula

a(n) = n*A055869(n-1).
Limit_{n -> oo} ( a(n)/a(n-1) - a(n-1)/a(n-2) ) -> e.
E.g.f.: (1-x)/(1-T), where T=T(x) is Euler's tree function (see A000169). The e.g.f. for n > 0 terms only (applicable to endofunctions) is (T - x)/(1 - T). - Len Smiley, Dec 10 2001