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.

A079162 a(n) = 5*a(n-2) - 2*a(n-4), with initial terms 0,1,2,4.

Original entry on oeis.org

0, 1, 2, 4, 10, 18, 46, 82, 210, 374, 958, 1706, 4370, 7782, 19934, 35498, 90930, 161926, 414782, 738634, 1892050, 3369318, 8630686, 15369322, 39369330, 70107974, 179585278, 319801226, 819187730, 1458790182, 3736768094, 6654348458, 17045465010, 30354161926, 77753788862
Offset: 0

Views

Author

Robert G. Wilson v, Dec 29 2002

Keywords

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := a[n] = If[ OddQ[n], a[n - 1] + 2a[n - 2], 2a[n - 1] + a[n - 2]]; Table[a[n], {n, 0, 30}]
    LinearRecurrence[{0,5,0,-2},{0,1,2,4},40] (* Harvey P. Dale, Jul 05 2022 *)

Formula

Also a(n) = a(n-1) + 2a(n-2) if n is odd, else a(n) = 2a(n-1) + a(n-2).
a(2n) = 2*A005824(2n), a(2n+1) = A052913(n) = A005824(2n) + A005824(2n+1).
G.f.: x*(1+2*x-x^2)/(1-5*x^2+2*x^4).

Extensions

Corrected the g.f. and index in formula with A052913 R. J. Mathar, Apr 01 2009, May 02 2009
a(31) onwards from Andrew Howroyd, Mar 19 2025