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.

A153773 a(2*n) = 3*a(2*n-1) - 1, a(2*n+1) = 3*a(2*n), with a(1)=1.

Original entry on oeis.org

1, 2, 6, 17, 51, 152, 456, 1367, 4101, 12302, 36906, 110717, 332151, 996452, 2989356, 8968067, 26904201, 80712602, 242137806, 726413417, 2179240251, 6537720752, 19613162256, 58839486767, 176518460301, 529555380902, 1588666142706, 4765998428117, 14297995284351
Offset: 1

Views

Author

Clark Kimberling, Jan 01 2009

Keywords

Examples

			a(2) = 3*1 - 1 = 2.
a(3) = 3*a(2) = 6.
a(4) = 3*a(3) - 1 = 17.
		

Crossrefs

Programs

  • Magma
    I:=[1,2,6]; [n le 3 select I[n] else 3*Self(n-1)+Self(n-2)-3*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Aug 28 2016
    
  • Mathematica
    Table[(5*3^n + 6 - 3*(-1)^n)/24 , {n,1,25}] (* or *) LinearRecurrence[{3, 1, -3}, {1, 2, 6}, 25] (* G. C. Greubel, Aug 27 2016 *)
    RecurrenceTable[{a[1] == 1, a[2] == 2, a[3] == 6, a[n] == 3 a[n-1] + a[n-2] - 3 a[n-3]}, a, {n, 30}] (* Vincenzo Librandi, Aug 28 2016 *)
  • PARI
    a(n) = (3^n*5)\/24 \\ Charles R Greathouse IV, Aug 28 2016

Formula

From R. J. Mathar, Oct 05 2009: (Start)
a(n) = 3*a(n-1) + a(n-2) - 3*a(n-3).
G.f.: x*(-1 + x + x^2)/((1-x) * (3*x-1) * (1+x)).
a(n) = (5*3^n + 6 - 3*(-1)^n)/24. (End)
E.g.f.: (1/24)*(-3*exp(-x) - 8 + 6*exp(x) + 5*exp(3*x)). - G. C. Greubel, Aug 27 2016