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.

A103204 a(1) = 2, a(2) = 4; a(n) = 2*a(n-1) - 1.

Original entry on oeis.org

2, 4, 7, 13, 25, 49, 97, 193, 385, 769, 1537, 3073, 6145, 12289, 24577, 49153, 98305, 196609, 393217, 786433, 1572865, 3145729, 6291457, 12582913, 25165825, 50331649, 100663297, 201326593, 402653185, 805306369, 1610612737, 3221225473
Offset: 1

Views

Author

Roger L. Bagula, Mar 19 2005

Keywords

Crossrefs

Programs

  • Mathematica
    a[1] = 2; a[2] = 4; a[n_] := a[n] = 2*a[n - 1] - 1; Table[a[n], {n, 1, 32}]
    Join[{2},NestList[2#-1&,4,40]] (* or *) LinearRecurrence[{3,-2},{2,4,7},40] (* Harvey P. Dale, Dec 04 2018 *)
  • PARI
    Vec(x*(2-2*x-x^2)/(1-3*x+2*x^2) + O(x^50)) \\ Michel Marcus, Jan 29 2016

Formula

a(n) = A003945(n-1) + 1.
a(n) = 3*2^(n-2) + 1 for n>1. - Ralf Stephan, May 18 2007
a(n) = A004119(n-1), n>1. - R. J. Mathar, Jun 11 2010
G.f.: x*(2-2*x-x^2)/(1-3*x+2*x^2). a(n) = 3*a(n-1)-2*a(n-2), n>3. - Colin Barker, Jan 29 2012