OFFSET
1,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..500
Index entries for linear recurrences with constant coefficients, signature (-1,-41).
FORMULA
a(n) = (-1)^n*(p^n + q^n), where p = (1 +sqrt(163)*i)/2 and q = (1 -sqrt(163)*i)/2.
From Colin Barker, Mar 17 2013: (Start)
a(n) = -a(n-1) -41*a(n-2), with a(0) = 2 and a(1) = -1.
G.f.: x*(2+x)/(1 +x +41*x^2). (End)
MATHEMATICA
(* First program *)
p:= (1 +Sqrt[163]*I)/2; q:= (1 -Sqrt[163]*I)/2; f[n_]:= (-1)^n*(p^n + q^n); Table[Simplify[f[n]], {n, 0, 30}] (* modified by G. C. Greubel, Mar 29 2021 *)
(* Second program *)
LinearRecurrence[{-1, -41}, {2, -1}, 30] (* Harvey P. Dale, Sep 04 2015 *)
PROG
(Magma)
R<x>:=PowerSeriesRing(Rationals(), 30);
Coefficients(R!( x*(2+x)/(1+x+41*x^2) )); // G. C. Greubel, Mar 29 2021
(Sage)
def A141527_list(prec):
P.<x> = PowerSeriesRing(QQ, prec)
return P( x*(2+x)/(1+x+41*x^2) ).list()
a=A141527_list(31); a[1:] # G. C. Greubel, Mar 29 2021
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Roger L. Bagula, Aug 11 2008
EXTENSIONS
New name from Colin Barker and Joerg Arndt, Mar 17 2013
STATUS
approved