login
A097073
Expansion of (1-x+2*x^2)/((1+x)*(1-2*x)).
25
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,3
COMMENTS
Partial sums are A097074.
Pairwise sums are {1, 1, 4, 16, 32, ...} or 2^n -Sum_{k=0..n} binomial(n,k)*(-1)^(n+k)*k.
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
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 *)
PROG
(Magma) [2*2^n/3+4*(-1)^n/3-0^n: n in [0..35]]; // Vincenzo Librandi, Aug 12 2011
(PARI) a(n)=([0, 1; 2, 1]^n*[1; 0])[1, 1] \\ Charles R Greathouse IV, Oct 03 2016
(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
CROSSREFS
Cf. A001045, A078008 (form a(n)=2^n-a(n-1)).
Sequence in context: A079902 A309128 A120033 * A019085 A303644 A298796
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Jul 22 2004
EXTENSIONS
Obscure variable k in Orlovsky comment replaced with a(n) by R. J. Mathar, Apr 23 2009
STATUS
approved