OFFSET
0,1
COMMENTS
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
J. V. Leyendekkers and A. G. Shannon, Pellian sequence relationships among pi, e, sqrt(2), Notes on Number Theory and Discrete Mathematics, Vol. 18, 2012, No. 2, 58-62. See Table 2.
Index entries for linear recurrences with constant coefficients, signature (3,-1,-1).
FORMULA
From Colin Barker, May 26 2018: (Start)
G.f.: 2*(1 - x - x^2) / ((1 - x)*(1 - 2*x - x^2)).
a(n) = (2 + (1-sqrt(2))^(1+n) + (1+sqrt(2))^(1+n)) / 2.
a(n) = 3*a(n-1) - a(n-2) - a(n-3) for n>2.
(End)
PROG
(PARI) Vec(2*(1 - x - x^2) / ((1 - x)*(1 - 2*x - x^2)) + O(x^40)) \\ Colin Barker, May 26 2018
(Magma) a:=[2, 4, 8]; [n le 3 select a[n] else 3*Self(n-1) - Self(n-2) - Self(n-3):n in [1..35]]; // Marius A. Burtea, Sep 29 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Dec 23 2012
STATUS
approved