OFFSET
1,3
COMMENTS
Lim_{n->oo} a(n)/a(n-1) is 2.3692054...; largest real eigenvalue of M and a root of the characteristic polynomial x^4 - x^3 - 3x^2 - x + 1.
a(n) is the top left entry of the n-th power of the 4 X 4 matrix M = [0,1,1,0; 1,1,1,0; 0,1,0,1; 1,0,1,0].
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,3,1,-1).
FORMULA
a(n) = a(n-1) + 3*a(n-2) + a(n-3) - a(n-4).
EXAMPLE
a(8) = 439 = a(7) + 3*a(6) + a(5) - a(4) = 185 + 3*79 + 32 - 15.
MATHEMATICA
LinearRecurrence[{1, 3, 1, -1}, {0, 1, 3, 5}, 40] (* Amiram Eldar, Feb 28 2020 *)
CoefficientList[Series[x^2(1+2x-x^2)/(1-x-3x^2-x^3+x^4), {x, 0, 40}], x] (* Harvey P. Dale, Mar 27 2026 *)
PROG
(Magma) I:=[0, 1, 3, 5]; [n le 4 select I[n] else Self(n-1) +3*Self(n-2) +Self(n-3) -Self(n-4): n in [1..41]]; // G. C. Greubel, Nov 13 2022
(SageMath)
def A120748_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( x^2*(1+2*x-x^2)/(1-x-3*x^2-x^3+x^4) ).list()
a=A120748_list(40); a[1:] # G. C. Greubel, Nov 13 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gary W. Adamson, Jul 01 2006
EXTENSIONS
More terms from Amiram Eldar, Feb 28 2020
STATUS
approved
