cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A009001 Expansion of e.g.f: (1+x)*cos(x).

This page as a plain text file.
%I A009001 #70 Dec 23 2024 17:48:16
%S A009001 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,
%T A009001 25,-1,-27,1,29,-1,-31,1,33,-1,-35,1,37,-1,-39,1,41,-1,-43,1,45,-1,
%U A009001 -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
%N A009001 Expansion of e.g.f: (1+x)*cos(x).
%C A009001 If signs are ignored, continued fraction for tan(1) (cf. A093178).
%H A009001 Harry J. Smith, <a href="/A009001/b009001.txt">Table of n, a(n) for n = 0..20000</a>
%H A009001 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,-2,0,-1).
%F A009001 a(n) = (-1)^(n/2) if n is even, n*(-1)^((n-1)/2) if n is odd.
%F A009001 a(n) = -a(n-2) if n is even, 2*a(n-1) - a(n-2) if n is odd. - _Michael Somos_, Jan 26 2014
%F A009001 From _Henry Bottomley_, Oct 19 2001: (Start)
%F A009001 a(n) = (n^n mod (n+1))*(-1)^floor(n/2) for n > 0.
%F A009001 a(n) = (-1)^n*(a(n-2) - a(n-1)) - a(n-3) for n > 2. (End)
%F A009001 G.f.: (1+x+x^2-x^3)/(1+x^2)^2.
%F A009001 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]
%F A009001 From _James C. McMahon_, Oct 12 2023: (Start)
%F A009001 a(0) = 1; for n > 1,
%F A009001 a(n) = a(n-1) * n if n mod 4 = 1,
%F A009001        a(n-1) - n if n mod 4 = 2,
%F A009001        a(n-1) * n if n mod 4 = 3,
%F A009001        a(n-1) + n if n mod 4 = 4. (End)
%e A009001 tan(1) = 1.557407724654902230... = 1 + 1/(1 + 1/(1 + 1/(3 + 1/(1 + ...)))). - _Harry J. Smith_, Jun 15 2009
%e A009001 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 + ...
%p A009001 seq(coeff(series(factorial(n)*(1+x)*cos(x), x,n+1),x,n),n=0..90); # _Muniru A Asiru_, Jul 21 2018
%t A009001 With[{nn=90},CoefficientList[Series[(1+x)Cos[x],{x,0,nn}],x]Range[0,nn]!] (* _Harvey P. Dale_, Jul 15 2012 *)
%t A009001 LinearRecurrence[{0, -2, 0, -1}, {1, 1, -1, -3}, 100] (* _Jean-François Alcover_, Feb 21 2020 *)
%t A009001 FoldList[If[Mod[#2, 4]==1, #1*#2, If[Mod[#2, 4]==2, #1-#2,If[Mod[#2,4] ==3,#1*#2,#1+#2]]]&, 1, Range[1, 85]] (* _James C. McMahon_, Oct 12 2023 *)
%o A009001 (PARI) {a(n) = (-1)^(n\2) * if( n%2, n, 1)} /* _Michael Somos_, Oct 16 2006 */
%o A009001 (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
%Y A009001 Cf. A009531, A049471 (decimal expansion of tan(1)).
%K A009001 sign,easy,nice
%O A009001 0,4
%A A009001 _R. H. Hardin_, _N. J. A. Sloane_, _Simon Plouffe_, _David W. Wilson_
%E A009001 Formula corrected by _Olivier Gérard_, Mar 15 1997
%E A009001 Definition clarified by _Harvey P. Dale_, Jul 15 2012