OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..320
Eric Weisstein's World of Mathematics, Incomplete Gamma Function
FORMULA
a(n) = (2*n! + exp(1)*n*(n - 1)*Gamma(n - 1, 1))/2, where Gamma(a, x) is the incomplete gamma function.
a(n + 1) - a(n)*(n + 1) = A000217(n).
a(n) = n*a(n-1) + binomial(n,2). - G. C. Greubel, Dec 22 2015
EXAMPLE
a(0) = 1;
a(1) = 1 + 0 = 1;
a(2) = 1 + 0 + 1 + 1 = 3;
a(3) = 3 + 0 + 3 + 1 + 3 + 2 = 12;
a(4) = 12 + 0 + 12 + 1 + 12 + 2 + 12 + 3 = 54;
a(5) = 54 + 0 + 54 + 1 + 54 + 2 + 54 + 3 + 54 + 4 = 280, etc.
MATHEMATICA
Table[(2 n! + Exp[1] n (n - 1) Gamma[n - 1, 1])/2, {n, 0, 22}]
RecurrenceTable[{a[n] == n*a[n - 1] + Binomial[n, 2], a[0] == 1}, a, {n, 0, 20}] (* G. C. Greubel, Dec 22 2015 *)
PROG
(PARI) a(n) = (2*n! + exp(1)*n*(n-1)*incgam(n-1, 1))\/2
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Dec 21 2015
STATUS
approved