OFFSET
0,4
COMMENTS
Previous name was: Weighted Fibonacci numbers.
From Peter Bala, Aug 18 2013: (Start)
The sequence occurs in the evaluation of the integral I(n) := int {u = 0..inf} exp(-u)*u^n/(1 + u) du. The result is I(n) = A153229(n) + (-1)^n*I(0), where I(0) = int {0..inf} exp(-u)/(1 + u) du = 0.5963473623... is known as Gompertz's constant. See A073003. Note also that I(n) = n!*int {u = 0..inf} exp(-u)/(1 + u)^(n+1) du. (End)
((-1)^(n+1))*a(n) = p(n,-1), where the polynomials p are defined at A248664. - Clark Kimberling, Oct 11 2014
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..200
FORMULA
a(0) = 0, a(1) = 1, and for n>=2, a(n) = (n-1) * a(n-2) + (n-2) * a(n-1).
For n>=1, a(n) = A058006(n-1) * (-1)^(n-1).
G.f.: G(0)*x/(1+x)/2, where G(k)= 1 + 1/(1 - x*(k+1)/(x*(k+1) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 24 2013
G.f.: 2*x/(1+x)/G(0), where G(k)= 1 + 1/(1 - 1/(1 - 1/(2*x*(k+1)) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 29 2013
G.f.: W(0)*x/(1+sqrt(x))/(1+x), where W(k) = 1 + sqrt(x)/( 1 - sqrt(x)*(k+1)/(sqrt(x)*(k+1) + 1/W(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 17 2013
a(n) ~ (n-1)! * (1 - 1/n + 1/n^3 + 1/n^4 - 2/n^5 - 9/n^6 - 9/n^7 + 50/n^8 + 267/n^9 + 413/n^10), where numerators are Rao Uppuluri-Carpenter numbers, see A000587. - Vaclav Kotesovec, Mar 16 2015
E.g.f.: exp(1)/exp(x)*(Ei(1, 1-x)-Ei(1, 1)). - Alois P. Heinz, Jul 05 2018
EXAMPLE
a(20) = 19 * a(18) + 18 * a(19) = 19 * 335990918918980 + 18 * 6066382786809020 = 6383827459460620 + 109194890162562360 = 115578717622022980
MAPLE
t1 := sum(n!*x^n, n=0..100): F := series(t1/(1+x), x, 100): for i from 0 to 40 do printf(`%d, `, i!-coeff(F, x, i)) od: # Zerinvary Lajos, Mar 22 2009
# second Maple program:
a:= proc(n) a(n):= `if`(n<2, n, (n-1)*a(n-2) +(n-2)*a(n-1)) end:
seq(a(n), n=0..25); # Alois P. Heinz, May 24 2013
MATHEMATICA
Join[{a = 0}, Table[b = n! - a; a = b, {n, 0, 100}]] (* Vladimir Joseph Stephan Orlovsky, Jun 28 2011 *)
RecurrenceTable[{a[0]==0, a[1]==1, a[n]==(n-1)a[n-2]+(n-2)a[n-1]}, a, {n, 30}] (* Harvey P. Dale, May 01 2020 *)
PROG
(C) unsigned long a(unsigned int n) {
if (n == 0) return 0;
if (n == 1) return 1;
return (n - 1) * a(n - 2) + (n - 2) * a(n - 1); }
(PARI) a(n)=if(n, my(t=(-1)^n); -t-sum(i=1, n-1, t*=-i), 0); \\ Charles R Greathouse IV, Jun 28 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Shaojun Ying (dolphinysj(AT)gmail.com), Dec 21 2008
EXTENSIONS
Edited by Max Alekseyev, Jul 05 2010
Better name by Joerg Arndt, Aug 17 2013
STATUS
approved