OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Eric Weisstein's World of Mathematics, Pell Equation
Index entries for linear recurrences with constant coefficients, signature (0,0,38,0,0,-1).
FORMULA
G.f.: -x*(7*x^5+13*x^4+57*x^3-13*x^2-7*x-3) / (x^6-38*x^3+1).
a(n) = 38*a(n-3)-a(n-6).
MATHEMATICA
CoefficientList[Series[-(7 x^6 + 13 x^5 + 57 x^4 - 13 x^3 - 7 x^2 - 3 x) / (x^6 - 38 x^3 + 1), {x, 1, 40}], x] (* Vincenzo Librandi, Aug 17 2013 *)
LinearRecurrence[{0, 0, 38, 0, 0, -1}, {3, 7, 13, 57, 253, 487}, 30] (* Harvey P. Dale, Jan 06 2014 *)
PROG
(PARI) Vec(-x*(7*x^5+13*x^4+57*x^3-13*x^2-7*x-3)/(x^6-38*x^3+1) + O(x^100))
(Magma) I:=[3, 7, 13, 57, 253, 487]; [n le 6 select I[n] else 38*Self(n-3)-Self(n-6): n in [1..30]]; // Vincenzo Librandi, Aug 17 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Colin Barker, Aug 16 2013
EXTENSIONS
a(1)=3 prepended by Max Alekseyev, Sep 04 2013
STATUS
approved