[go: up one dir, main page]

login

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”).

A097072
Expansion of (1 - 2*x + 2*x^2)/((1 - x^2)*(1 - 2*x)).
4
1, 0, 3, 4, 11, 20, 43, 84, 171, 340, 683, 1364, 2731, 5460, 10923, 21844, 43691, 87380, 174763, 349524, 699051, 1398100, 2796203, 5592404, 11184811, 22369620, 44739243, 89478484, 178956971, 357913940, 715827883, 1431655764, 2863311531, 5726623060, 11453246123
OFFSET
0,3
FORMULA
a(n) = (4*2^n - 3 + 5*(-1)^n)/6.
a(n) = Sum_{k=0..n} (2^k - 1 + 0^k)(-1)^(n-k).
a(n) = A001045(n+1) - A000035(n).
a(n) = a(n-1) + 2*a(n-2) + 1, n > 1. - Gary Detlefs, Jun 20 2010
a(2*n) = A007583(n), a(2*n+1) = A080674(n), n >= 0. - Yosu Yurramendi, Feb 21 2017
a(n) = A000975(n) + (-1)^n. - Alois P. Heinz, Jun 15 2023
MAPLE
a:= n-> ceil(2*(2^n-1)/3)+(-1)^n:
seq(a(n), n=0..32); # Alois P. Heinz, Jun 15 2023
MATHEMATICA
CoefficientList[Series[(1-2x+2x^2)/((1-x^2)(1-2x)), {x, 0, 50}], x] (* Harvey P. Dale, Mar 09 2011 *)
Table[2*2^n/3 - 1/2 + 5 (-1)^n/6, {n, 0, 32}] (* Michael De Vlieger, Feb 22 2017 *)
PROG
(PARI) for(n=0, 50, print1((4*2^n - 3 + 5*(-1)^n)/6, ", ")) \\ G. C. Greubel, Oct 10 2017
(Magma) [(4*2^n - 3 + 5*(-1)^n)/6: n in [0..50]]; // G. C. Greubel, Oct 10 2017
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Jul 22 2004
STATUS
approved