Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #21 May 08 2024 05:48:37
%S 1,1,-2,-2,2,2,-2,-2,2,2,-2,-2,2,2,-2,-2,2,2,-2,-2,2,2,-2,-2,2,2,-2,
%T -2,2,2,-2,-2,2,2,-2,-2,2,2,-2,-2,2,2,-2,-2,2,2,-2,-2,2,2,-2,-2,2,2,
%U -2,-2,2,2,-2,-2,2,2,-2,-2,2,2,-2,-2,2,2,-2,-2,2,2,-2,-2,2,2,-2,-2,2,2,-2,-2,2,2,-2,-2,2,2,-2
%N Expansion of (1+x-x^2-x^3)/(1+x^2).
%C Partial sums are A084099.
%C The unsigned sequence 1,1,2,2,2,2,.. has g.f. (1+x^2)/(1-x) and a(n)=sum{k=0..n, binomial(1,k/2)(1+(-1)^k)/2}. Its partial sums are A004275(n+1). The sequence 1,-1,2,-2,2,-2,... has g.f. (1+x^2)/(1+x) and a(n)=sum{k=0..n, (-1)^(n-k)binomial(1,k/2)(1+(-1)^k)/2}. - _Paul Barry_, Oct 15 2004
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0,-1).
%F Euler transform of length 4 sequence [1, -3, 0, 1]. - _Michael Somos_, Jan 05 2017
%F G.f.: (1 + x) * (1 - x^2) / (1 + x^2). - _Michael Somos_, Jan 05 2017
%F a(n) = a(1-n) for all n in Z. - _Michael Somos_, Jan 05 2017
%F a(2*n) = a(2*n + 1) = A280560(n) for all n in Z. - _Michael Somos_, Jan 05 2017
%e G.f. = 1 + x - 2*x^2 - 2*x^3 + 2*x^4 + 2*x^5 - 2*x^6 - 2*x^7 + 2*x^8 + 2*x^9 + ...
%t CoefficientList[Series[(1+x-x^2-x^3)/(1+x^2),{x,0,100}],x] (* _Harvey P. Dale_, Apr 20 2011 *)
%t a[ n_] := (-1)^Quotient[n, 2] If[ Quotient[n, 2] != 0, 2, 1]; (* _Michael Somos_, Jan 05 2017 *)
%o (PARI) {a(n) = (-1)^(n\2) * if( n\2, 2, 1)}; /* _Michael Somos_, Jan 05 2017 */
%Y Cf. A084099, A280560.
%K easy,sign
%O 0,3
%A _Paul Barry_, May 15 2003