A097073 Expansion of (1-x+2*x^2)/((1+x)*(1-2*x)).
1, 0, 4, 4, 12, 20, 44, 84, 172, 340, 684, 1364, 2732, 5460, 10924, 21844, 43692, 87380, 174764, 349524, 699052, 1398100, 2796204, 5592404, 11184812, 22369620, 44739244, 89478484, 178956972, 357913940, 715827884, 1431655764, 2863311532
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1,2).
Programs
-
Magma
[2*2^n/3+4*(-1)^n/3-0^n: n in [0..35]]; // Vincenzo Librandi, Aug 12 2011
-
Mathematica
k=0;lst={1, k};Do[k=2^n-k;AppendTo[lst, k], {n, 2, 5!}];lst (* Vladimir Joseph Stephan Orlovsky, Dec 11 2008 *) CoefficientList[Series[(1-x+2x^2)/((1+x)(1-2x)),{x,0,40}],x] (* Harvey P. Dale, Dec 10 2012 *)
-
PARI
a(n)=([0,1; 2,1]^n*[1;0])[1,1] \\ Charles R Greathouse IV, Oct 03 2016
-
Python
def A097073(n): return ((1<
Chai Wah Wu, Apr 18 2025 -
SageMath
def A097073(n): return 1 if (n==0) else 2*(2^n +2*(-1)^n)/3 [A097073(n) for n in (0..40)] # G. C. Greubel, Aug 19 2022
Formula
a(n) = (2*2^n + 4*(-1)^n)/3 - 0^n.
a(n) = A001045(n+1) + (-1)^n - 0^n.
a(n) = 2*A078008(n) - 0^n.
a(2*n+1) + a(2*n+2) = A000302(n+1). - Paul Curtz, Jun 30 2008
G.f.: 1 - x + x*Q(0), where Q(k) = 1 + 2*x^2 + (4*k+5)*x - x*(4*k+1 + 2*x)/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Oct 07 2013
E.g.f.: (1/3)*( 2*exp(2*x) + 4*exp(-x) - 3 ). - G. C. Greubel, Aug 19 2022
Extensions
Obscure variable k in Orlovsky comment replaced with a(n) by R. J. Mathar, Apr 23 2009
Comments