cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A097072 Expansion of (1 - 2*x + 2*x^2)/((1 - x^2)*(1 - 2*x)).

Original entry on oeis.org

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

Views

Author

Paul Barry, Jul 22 2004

Keywords

Crossrefs

Programs

  • Magma
    [(4*2^n - 3 + 5*(-1)^n)/6: n in [0..50]]; // G. C. Greubel, Oct 10 2017
  • 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 *)
  • PARI
    for(n=0,50, print1((4*2^n - 3 + 5*(-1)^n)/6, ", ")) \\ G. C. Greubel, Oct 10 2017
    

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