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.

A290604 a(0) = 2, a(1) = 2; for n > 1, a(n) = a(n-1) + 2*a(n-2) + 3.

Original entry on oeis.org

2, 2, 9, 16, 37, 72, 149, 296, 597, 1192, 2389, 4776, 9557, 19112, 38229, 76456, 152917, 305832, 611669, 1223336, 2446677, 4893352, 9786709, 19573416, 39146837, 78293672, 156587349, 313174696, 626349397, 1252698792, 2505397589, 5010795176, 10021590357
Offset: 0

Views

Author

Iain Fox, Oct 11 2017

Keywords

Comments

Ratio of successive terms approaches 2.

Examples

			a(0) = 2.
a(1) = 2.
a(2) = 2 + 2*2 + 3 = 9.
a(3) = 9 + 2*2 + 3 = 16.
a(4) = 16 + 9*2 + 3 = 37.
...
		

Programs

  • Magma
    [(2^(n+2)+2*(-1)^n)/3+2^n-(3-(-1)^n)/2: n in [0..40]]; // Vincenzo Librandi, Oct 20 2017
  • Mathematica
    Table[(2^(n + 2) + 2 (-1)^n) / 3 + 2^n - (3 - (-1)^n) / 2, {n, 0, 40}] (* Vincenzo Librandi, Oct 20 2017 *)
    LinearRecurrence[{2,1,-2},{2,2,9},50] (* Harvey P. Dale, Mar 06 2025 *)
  • PARI
    Vec((2/(1-x-2*x^2)) + (3*x^2/((1-x)*(1-x-2*x^2))) + O(x^50)) \\ Michel Marcus, Oct 12 2017
    
  • PARI
    first(n) = Vec((2 - 2*x + 3*x^2)/(1 - 2*x - x^2 + 2*x^3) + O(x^n)) \\ Iain Fox, Dec 18 2017
    

Formula

a(n) = (2^(n+2) + 2*(-1)^n)/3 + 2^n - (3-(-1)^n)/2.
a(n) = A014113(n+1) + A141023(n).
G.f.: (2 - 2*x + 3*x^2)/(1 - 2*x - x^2 + 2*x^3).
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3), n > 2. - Iain Fox, Dec 18 2017