OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (2, -7).
FORMULA
a(n) = 2*a(n-1) - 7*a(n-2); a(1)=1, a(2)=2. - T. D. Noe, Dec 11 2006
G.f.: x/(1 - 2*x + 7*x^2). - Philippe Deléham, Mar 04 2012
MATHEMATICA
LinearRecurrence[{2, -7}, {1, 2}, 40] (* Harvey P. Dale, Nov 04 2011 *)
PROG
(Sage) [lucas_number1(n, 2, 7) for n in range(1, 18)] # Zerinvary Lajos, Apr 23 2009
(PARI) x='x+O('x^30); Vec(x/(1-2*x+7*x^2)) \\ G. C. Greubel, Oct 22 2018
(Magma) I:=[1, 2]; [n le 2 select I[n] else 2*Self(n-1) - 7*Self(n-2): n in [1..30]]; // G. C. Greubel, Oct 22 2018
(GAP) a:=[1, 2];; for n in [3..30] do a[n]:=2*a[n-1]-7*a[n-2]; od; a; # Muniru A Asiru, Oct 23 2018
CROSSREFS
KEYWORD
sign
AUTHOR
Simone Severini, Dec 08 2003
STATUS
approved