login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A009001 Expansion of e.g.f: (1+x)*cos(x). 5
1, 1, -1, -3, 1, 5, -1, -7, 1, 9, -1, -11, 1, 13, -1, -15, 1, 17, -1, -19, 1, 21, -1, -23, 1, 25, -1, -27, 1, 29, -1, -31, 1, 33, -1, -35, 1, 37, -1, -39, 1, 41, -1, -43, 1, 45, -1, -47, 1, 49, -1, -51, 1, 53, -1, -55, 1, 57, -1, -59, 1, 61, -1, -63, 1, 65, -1, -67, 1, 69, -1, -71, 1, 73, -1, -75, 1, 77, -1, -79, 1, 81, -1, -83, 1, 85 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

If signs are ignored, continued fraction for tan(1) (cf. A093178).

LINKS

Harry J. Smith, Table of n, a(n) for n = 0..20000

Index entries for linear recurrences with constant coefficients, signature (0,-2,0,-1).

FORMULA

a(n) = (-1)^(n/2) if n even, n*(-1)^((n-1)/2) if n odd.

a(n) = -a(n-2) if n even, 2*a(n-1) - a(n-2) if n odd. - Michael Somos, Jan 26 2014

a(n) =(n^n mod (n+1))*(-1)^floor(n/2) for n > 0 = (-1)^n*(a(n-2) - a(n-1)) - a(n-3) for n > 2. - Henry Bottomley, Oct 19 2001

G.f.: (1+x+x^2-x^3)/(1+x^2)^2. E.g.f: (1+x)*cos(x).

E.g.f.: (1+x)*cos(x) = U(0) where U(k) = 1 + x - x^2/((2*k+1)*(2*k+2)) * U(k+1). - Sergei N. Gladkovskii, Oct 17 2012 [Edited by Michael Somos, Jan 26 2014]

EXAMPLE

tan(1) = 1.557407724654902230... = 1 + 1/(1 + 1/(1 + 1/(3 + 1/(1 + ...)))). - Harry J. Smith, Jun 15 2009

G.f. = 1 + x - x^2 - 3*x^3 + x^4 + 5*x^5 - x^6 - 7*x^7 + x^8 + 9*x^9 - x^10 + ...

MAPLE

seq(coeff(series(factorial(n)*(1+x)*cos(x), x, n+1), x, n), n=0..90); # Muniru A Asiru, Jul 21 2018

MATHEMATICA

With[{nn=90}, CoefficientList[Series[(1+x)Cos[x], {x, 0, nn}], x]Range[0, nn]!] (* Harvey P. Dale, Jul 15 2012 *)

LinearRecurrence[{0, -2, 0, -1}, {1, 1, -1, -3}, 100] (* Jean-François Alcover, Feb 21 2020 *)

PROG

(PARI) {a(n) = (-1)^(n\2) * if( n%2, n, 1)} /* Michael Somos, Oct 16 2006 */

(PARI) { allocatemem(932245000); default(realprecision, 79000); x=contfrac(tan(1)); for (n=0, 20000, write("b009001.txt", n, " ", (-1)^(n\2)*x[n+1])); } \\ Harry J. Smith, Jun 15 2009

(MAGMA) m:=50; R<x>:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!((1+x)*Cos(x))); [Factorial(n-1)*b[n]: n in [1..m]]; // G. C. Greubel, Jul 21 2018

CROSSREFS

Cf. A009531, A049471 (decimal expansion of tan(1)).

Sequence in context: A274660 A327531 A327514 * A093178 A340086 A307153

Adjacent sequences:  A008998 A008999 A009000 * A009002 A009003 A009004

KEYWORD

sign,easy,nice

AUTHOR

R. H. Hardin, N. J. A. Sloane, Simon Plouffe, David W. Wilson

EXTENSIONS

Formula corrected by Olivier Gérard, Mar 15 1997

Definition clarified by Harvey P. Dale, Jul 15 2012

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 17 16:12 EDT 2021. Contains 343063 sequences. (Running on oeis4.)