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.

A192395 a(n) = 2*a(n-1) - 2*a(n-2) + a(n-3) + 2*a(n-4) starting with a(0..3) = 0, 0, 0, 1.

Original entry on oeis.org

0, 0, 0, 1, 2, 2, 1, 2, 8, 17, 22, 22, 33, 78, 156, 233, 298, 442, 833, 1546, 2464, 3553, 5390, 9230, 16161, 26358, 40404, 62713, 103298, 174290, 285505, 451154, 712184, 1156145, 1910086, 3122374, 5005089, 7987806, 12907980, 21090185, 34362394, 55428010
Offset: 0

Views

Author

Paul Curtz, Jun 29 2011

Keywords

Crossrefs

Programs

  • Magma
    I:=[0,0,0,1]; [n le 4 select I[n] else 2*Self(n-1)-2*Self(n-2)+Self(n-3)+2*Self(n-4): n in [1..50]]; // Vincenzo Librandi, Nov 25 2011
    
  • Maple
    a:= n-> (<<0|1|0|0>, <0|0|1|0>, <0|0|0|1>, <2|1|-2|2>>^n)[1,4]:
    seq(a(n), n=0..45);  # Alois P. Heinz, Jul 11 2023
  • Mathematica
    LinearRecurrence[{2,-2,1,2},{0,0,0,1},100] (* Vincenzo Librandi, Nov 25 2011 *)
  • SageMath
    @CachedFunction
    def a(n): # a = A192395
        if (n<4): return n//3
        else: return 2*a(n-1) - 2*a(n-2) + a(n-3) + 2*a(n-4)
    [a(n) for n in range(51)] # G. C. Greubel, Jul 10 2023

Formula

From R. J. Mathar, Jul 14 2011: (Start)
G.f.: x^3/((1-x+2*x^2)*(1-x-x^2)).
a(n) = (A000045(n) - A107920(n))/3. (End)