OFFSET
0,3
COMMENTS
a(n) equals the imaginary part of the permanent of the n X n matrix with (1+i)'s along the main diagonal, and 1's everywhere else. - John M. Campbell, Jul 10 2011
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..200
Eric Weisstein's MathWorld, Incomplete Gamma Function.
FORMULA
a(n) = round(n!*sin(1)), n>=1. - Vladeta Jovovic, Aug 11 2002
a(n) = n! * Sum_{k=0..floor(n/2)} (-1)^k/(2k-1)!, n>0. - Ralf Stephan, Apr 16 2004
a(n) = n*a(n-1) - a(n-2) +(n-2)*a(n-3). - Vaclav Kotesovec, Oct 07 2012
From Vladimir Reshetnikov, Oct 27 2015: (Start)
a(n) = Im(i^n*hypergeom([1,-n], [], i)).
a(n) = n!*sin(1)-cos(Pi*n/2)*hypergeom([1], [n/2+1,(n+3)/2], -1/4)/(n+1) + sin(Pi*n/2)*hypergeom([1], [n/2+2,(n+3)/2], -1/4)/(n^2+3*n+2).
a(n) = Im(Gamma(n+1, i)*exp(i)) = (Gamma(n+1, i)*exp(i)-Gamma(n+1, -i)*exp(-i))/(2*i), where Gamma(a, x) is the upper incomplete Gamma function, i=sqrt(-1).
Gamma(n+1, i) = exp(-i)*((-1)^n*A009102(n) + a(n)*i). (End)
MAPLE
restart: G(x):=sin(x)/(1-x): f[0]:=G(x): for n from 1 to 21 do f[n]:=diff(f[n-1], x) od: x:=0: seq(f[n], n=0..20); # Zerinvary Lajos, Apr 03 2009
MATHEMATICA
Table[n!*SeriesCoefficient[Sin[x]/(1-x), {x, 0, n}], {n, 0, 20}] (* corrected by Vaclav Kotesovec, Oct 07 2012 *)
With[{nn=30}, CoefficientList[Series[Sin[x]/(1-x), {x, 0, nn}], x] Range[0, nn]!] (* Harvey P. Dale, Apr 17 2013 *)
Round@Table[Im[Gamma[n+1, I] E^I], {n, 0, 20}] (* Vladimir Reshetnikov, Oct 27 2015 *)
PROG
(PARI) a(n) = round(n!*sin(1))
(Magma) I:=[1, 2, 5]; [0] cat [n le 3 select I[n] else n*Self(n-1)-Self(n-2)+(n-2)*Self(n-3): n in [1..30]]; // G. C. Greubel, Jan 19 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Benoit Cloitre, Aug 13 2002
STATUS
approved