OFFSET
0,4
LINKS
Robert Israel, Table of n, a(n) for n = 0..449
Larry Carter and Stan Wagon, The Mensa Correctional Institute, The American Mathematical Monthly 125.4 (2018): 306-319.
FORMULA
E.g.f.: (1 - exp(-x^2/2)) / (1-x).
a(n) = n! * ( 1 - Sum_{k=0..floor(n/2)} (-1)^k / (2^k * k!) ).
a(n) + A000266(n) = n!. - Yuval Dekel (dekelyuval(AT)hotmail.com), Nov 09 2003
Limit_{n -> oo} a(n)/n! = 1 - e^(-1/2) = 1 - A092605. - Michel Marcus, Aug 08 2013
MAPLE
S:= series((1-exp(-x^2/2))/(1-x), x, 101):
seq(coeff(S, x, j)*j!, j=0..100); # Robert Israel, May 12 2016
MATHEMATICA
nn=30; Table[n!, {n, 0, nn}]-Range[0, nn]!CoefficientList[Series[Exp[-x^2/2]/(1-x), {x, 0, nn}], x] (* Geoffrey Critzer, Oct 20 2012 *)
PROG
(PARI)
a(n) = n! * (1 - sum(k=0, floor(n/2), (-1)^k / (2^k * k!) ) );
/* Joerg Arndt, Oct 20 2012 */
(PARI)
N=33; x='x+O('x^N);
v=Vec( 'a0 + serlaplace( (1-exp(-x^2/2))/(1-x) ) );
v[1]-='a0; v
/* Joerg Arndt, Oct 20 2012 */
(Magma)
A027616:= func< n | Factorial(n)*(1- (&+[(-1/2)^j/Factorial(j): j in [0..Floor(n/2)]]) ) >;
[A027616(n): n in [0..30]]; // G. C. Greubel, Aug 05 2022
(SageMath)
def A027616(n): return factorial(n)*(1-sum((-1/2)^k/factorial(k) for k in (0..(n//2))))
[A027616(n) for n in (0..30)] # G. C. Greubel, Aug 05 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Joe Keane (jgk(AT)jgk.org)
EXTENSIONS
Added more terms, Geoffrey Critzer, Oct 20 2012
STATUS
approved