OFFSET
0,4
COMMENTS
The absolute value of a(n) equals the real 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
Robert Israel, Table of n, a(n) for n = 0..438
Eric Weisstein's MathWorld, Incomplete Gamma Function.
FORMULA
a(n) = (-1)^n*round(n!*cos(1)). - Vladeta Jovovic, Aug 11 2002
a(n) = (-1)^n * n! * Sum_{k=0..floor(n/2)} (-1)^k/(2k)!. Unsigned sequence satisfies e.g.f. cos(x)/(1-x). - Ralf Stephan, Apr 16 2004
E.g.f.: cos(x)/(1+x) = U(0)/(1-x^2) where U(k) = 1 - x/(1 - x/(x + (2*k+1)*(2*k+2)/U(k+1))) ; (continued fraction, 3-step). - Sergei N. Gladkovskii, Oct 17 2012
From Vladimir Reshetnikov, Oct 27 2015: (Start)
a(n) = Re((-i)^n*hypergeom([1,-n], [], i)).
a(n) = (-1)^n*(cos(1)*(n+2)!+cos(Pi*n/2)*hypergeom([1], [n/2+2,(n+3)/2], -1/4)+sin(Pi*n/2)*(n+2)*hypergeom([1], [n/2+1,(n+3)/2], -1/4))/(n^2+3*n+2).
a(n) = (-1)^n*Re(Gamma(n+1, i)*exp(i)) = (-1)^n*(Gamma(n+1, i)*exp(i)+Gamma(n+1, -i)*exp(-i))/2, where Gamma(a, x) is the upper incomplete Gamma function, i=sqrt(-1).
Gamma(n+1, i) = exp(-i)*((-1)^n*a(n) + A009551(n)*i).
a(0) = 1, a(1) = -1, a(2) = 1, a(n+3) = -(n+3)*a(n+2)-a(n+1)-(n+1)*a(n). (End)
MAPLE
G(x):=cos(x)/(1+x): f[0]:=G(x): for n from 1 to 20 do f[n]:=diff(f[n-1], x) od: x:=0: seq(f[n], n=0..20); # Zerinvary Lajos, Apr 03 2009
g:= gfun:-rectoproc({a(0) = 1, a(1) = -1, a(2) = 1, a(n+3) = -(n+3)*a(n+2)-a(n+1)-(n+1)*a(n)}, a(n), remember):
seq(g(n), n=0..30); # Robert Israel, Oct 27 2015
MATHEMATICA
Table[SeriesCoefficient[Cos[x]/(1+x), {x, 0, n}] n!, {n, 0, 20}]
Round@Table[(-1)^n Re[Gamma[n+1, I] E^I], {n, 0, 20}] (* Vladimir Reshetnikov, Oct 27 2015 *)
With[{nn=20}, CoefficientList[Series[Cos[x]/(1+x), {x, 0, nn}], x] Range[0, nn]!] (* Harvey P. Dale, Feb 18 2024 *)
PROG
(PARI) x='x+O('x^30); Vec(serlaplace(cos(x)/(1+x))) \\ G. C. Greubel, Jul 26 2018
(Magma) m:=30; R<x>:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!(Cos(x)/(1+x))); [Factorial(n-1)*b[n]: n in [1..m]]; // G. C. Greubel, Jul 26 2018
CROSSREFS
KEYWORD
sign,easy
AUTHOR
EXTENSIONS
Extended with signs by Olivier Gérard, Mar 15 1997
STATUS
approved