OFFSET
0,3
COMMENTS
Top left element of powers of the matrix [1,2;3,4].
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (5,2).
FORMULA
a(n)/a(n-1) tends to (sqrt(33) + 5)/2 = 5.37228132... - Gary W. Adamson, Mar 03 2008
G.f.: (1 - 4*x)/(1 - 5*x - 2*x^2). - G. C. Greubel, Oct 23 2019
EXAMPLE
a(5) = 1069 because [1,2;3,4]^5 = [1069,1558; 2337,3406].
MAPLE
seq(coeff(series((1-4*x)/(1-5*x-2*x^2), x, n+1), x, n), n = 0..30); # G. C. Greubel, Oct 23 2019
MATHEMATICA
Table[MatrixPower[{{1, 2}, {3, 4}}, n][[1]][[1]], {n, 0, 30}]
Transpose[NestList[Flatten[{Rest[#], ListCorrelate[{2, 5}, #]}]&, {1, 1}, 40]][[1]] (* Harvey P. Dale, Mar 23 2011 *)
LinearRecurrence[{5, 2}, {1, 1}, 30] (* Harvey P. Dale, Jan 01 2014 *)
PROG
(PARI) Vec((1-4*x)/(1-5*x-2*x^2) +O('x^30)) \\ G. C. Greubel, Oct 23 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (1-4*x)/(1-5*x-2*x^2) )); // G. C. Greubel, Oct 23 2019
(Magma) [n le 2 select 1 else 5*Self(n-1) + 2*Self(n-2):n in [1..22]]; // Marius A. Burtea, Oct 24 2019
(Sage)
def A124610_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( (1-4*x)/(1-5*x-2*x^2) ).list()
A124610_list(30) # G. C. Greubel, Oct 23 2019
(GAP) a:=[1, 1];; for n in [3..30] do a[n]:=5*a[n-1]+2*a[n-2]; od; a; # G. C. Greubel, Oct 23 2019
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Fredrik Johansson, Dec 20 2006
EXTENSIONS
Recurrence from Gary W. Adamson, Mar 03 2008
STATUS
approved