OFFSET
0,1
LINKS
Robert Israel, Table of n, a(n) for n = 0..447
FORMULA
E.g.f.: exp(x)*(2-x)/(1-x)^3.
a(n) = (1/2) * (floor((n+1)*(n+1)!*e) + floor(n*n!*e)). [Gary Detlefs, Jun 06 2010]
a(n) = (1/2) * (3 + n + (1 + 3*n + n^2) * A000522(n)). - Gerry Martens, Oct 02 2016
a(n) = ((4+3*n)*a(n-1) - (n+3)*(n-1)*a(n-2) + (n-1)*(n-2)*a(n-3))/2. - Robert Israel, Oct 02 2016
From Peter Bala, May 27 2022: (Start)
a(n) = (1/2)*Sum_{k = 0..n} binomial(n,k)*(k+4)*(k+1)!; binomial transform of A038720(n+1).
a(n) = (1/2)*e*Integral_{x >= 1} x^n*(x^2 - 1)*exp(-x).
a(2*n) is even and a(2*n+1) is odd. More generally, a(n+k) == a(n) (mod k) for all n and k. It follows that for each positive integer k, the sequence obtained by reducing a(n) modulo k is periodic, with the exact period dividing k. Various divisibility properties of the sequence follow from this; for example, a(3*n+2) == 0 (mod 3), a(5*n+2) == a(5*n+3) (mod 5), a(7*n+1) == 0 (mod 7) and a(11*n+4) == 0 (mod 11). (End)
a(n) = (n*(n^2 + 3*n + 1)*a(n-1) - (n + 2))/(n^2 + n - 1), with a(0) = 2. - G. C. Greubel, Oct 07 2023
MAPLE
f:= rectoproc({a(n)=((4+3*n)*a(n-1)-(n+3)*(n-1)*a(n-2)+(n-1)*(n-2)*a(n-3))/2, a(0)=2, a(1)=7, a(2)=30}, a(n), remember):
map(f, [$0..40]); # Robert Israel, Oct 02 2016
MATHEMATICA
(* First program *)
t[0, _] = 1; t[n_, 0] := t[n, 0] = t[n-1, 1];
t[n_, k_] := t[n, k] = t[n-1, k+1] + k*t[n, k-1];
a[n_] := t[2, n];
Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Aug 19 2022 *)
(* Second program *)
a[n_]:= a[n]= If[n==0, 2, (n*(n^2+3*n+1)*a[n-1] -(n+2))/(n^2+n-1)];
Table[a[n], {n, 0, 40}] (* G. C. Greubel, Oct 07 2023 *)
PROG
(Magma)
A144495:= func< n | (&+[Binomial(n, k)*(k+4)*Factorial(k+1) : k in [0..n]])/2 >;
[A144495(n): n in [0..40]]; // G. C. Greubel, Oct 07 2023
(SageMath)
def A144495(n): return sum(binomial(n, j)*factorial(j+1)*(j+4) for j in range(n+1))/2
[A144495(n) for n in range(41)] # G. C. Greubel, Oct 07 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
David Applegate and N. J. A. Sloane, Dec 13 2008
STATUS
approved