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.

A215502 a(n) = (1+sqrt(3))^n + (-2)^n + (1-sqrt(3))^n + 1.

Original entry on oeis.org

4, 1, 13, 13, 73, 121, 481, 1009, 3361, 7969, 24193, 61249, 177025, 464257, 1307137, 3493633, 9699841, 26190337, 72173569, 195941377, 537802753, 1464342529, 4010582017, 10937266177, 29920862209, 81665925121, 223274237953, 609678999553, 1666309128193
Offset: 0

Views

Author

Peter Luschny, Aug 13 2012

Keywords

Crossrefs

Programs

  • Magma
    [Round((1+Sqrt(3))^n + (-2)^n + (1-Sqrt(3))^n + 1): n in [0..30]]; // G. C. Greubel, Apr 23 2018
  • Maple
    A215502 := n -> 1+(1+sqrt(3))^n+(-2)^n+(1-sqrt(3))^n;
    seq(simplify(A215502(i)),i=0..28);
  • Mathematica
    Simplify/@Table[(1+Sqrt[3])^n+(1-Sqrt[3])^n+1+(-2)^n,{n,0,30}] (* or *) LinearRecurrence[{1,6,-2,-4},{4,1,13,13},30] (* Harvey P. Dale, Mar 12 2013 *)
  • PARI
    x='x+O('x^30); Vec((4-3*x-12*x^2+2*x^3)/((1-x)*(1+2*x)*(1-2*x-2*x^2))) \\ G. C. Greubel, Apr 23 2018
    

Formula

From Colin Barker, Aug 20 2012: (Start)
a(n) = a(n-1) +6*a(n-2) -2*a(n-3) -4*a(n-4).
G.f.: (4-3*x-12*x^2+2*x^3)/((1-x)*(1+2*x)*(1-2*x-2*x^2)). (End)