OFFSET
0,3
COMMENTS
Obviously, a(n) is always an even number. - Altug Alkan, Sep 28 2015
FORMULA
E.g.f.: A(x) = B'(x)*(1-x/B(x))^2, where B(x) is g.f. of A000169.
a(n) = Sum{k=1..n} (k!*binomial(n-1,k-2)*stirling2(n,k)), n>0, a(0)=0.
MATHEMATICA
Join[{0}, Table[(n + 1)^n - 2 (n^n) + (n - 1)^n, {n, 30}]] (* Vincenzo Librandi, Sep 28 2015 *)
PROG
(Maxima)
B(x):=-lambert_w(-x);
makelist(n!*coeff(taylor(diff(B(x), x)*(1-x/B(x))^2, x, 0, 20), x, n), n, 0, 10);
(PARI) a(n) = (n+1)^n - 2*(n^n) + (n-1)^n;
vector(30, n, a(n-1)) \\ Altug Alkan, Sep 28 2015
(Magma) [(n+1)^n - 2*(n^n) + (n-1)^n: n in [0..30]]; // Vincenzo Librandi, Sep 28 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vladimir Kruchinin, Sep 28 2015
STATUS
approved