A106664 Expansion of g.f.: (1-3*x+x^2)/((1-x)*(1+x)*(1-2*x+2*x^2)).
-1, 1, 2, 5, 4, 1, -8, -15, -16, 1, 32, 65, 64, 1, -128, -255, -256, 1, 512, 1025, 1024, 1, -2048, -4095, -4096, 1, 8192, 16385, 16384, 1, -32768, -65535, -65536, 1, 131072, 262145, 262144, 1, -524288, -1048575, -1048576, 1, 2097152, 4194305, 4194304, 1, -8388608, -16777215, -16777216, 1, 33554432
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,-1,-2,2).
Programs
-
Magma
R
:=PowerSeriesRing(Integers(), 50); Coefficients(R!( (1-3*x+x^2)/((1-x^2)*(1-2*x+2*x^2)) )); // G. C. Greubel, Sep 08 2021 -
Mathematica
CoefficientList[Series[(1-3x+x^2)/((1-x)(1+x)(1-2x+2x^2)),{x,0,60}],x] (* Harvey P. Dale, Mar 20 2013 *)
-
SageMath
def A106664_list(prec): P.
= PowerSeriesRing(QQ, prec) return P( sinh(x) -exp(x)*(cos(x)-sin(x)) ).egf_to_ogf().list() A106664_list(50) # G. C. Greubel, Sep 08 2021
Formula
a(n) = (1/2)*(1 - (-1)^n - (1-i)^(n+1) - (1+i)^(n+1)), with i=sqrt(-1). - Ralf Stephan, Nov 16 2010
From G. C. Greubel, Sep 08 2021: (Start)
a(n) = (1-(-1)^n)/2 - 2^((n+1)/2)*cos((n+1)*Pi/4).
E.g.f.: sinh(x) - exp(x)*(cos(x) - sin(x)). (End)
Comments