OFFSET
1,2
COMMENTS
Three consecutive terms of the sequence define a polynomial a(3n+1)*x^2 - a(3n+2)*x +a(3n+3) which has a root x = 1 + n + golden ratio.
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,3,0,0,-3,0,0,1).
FORMULA
a(n) = 3*a(n-3) -3*a(n-6) +a(n-9).
G.f.: x*(-1-3*x-x^2+2*x^3+4*x^4-2*x^5-x^6-x^7+x^8)/((x-1)^3*(1+x+x^2)^3).
MAPLE
seq(coeff(series(x*(-1-3*x-x^2+2*x^3+4*x^4-2*x^5-x^6-x^7+x^8)/((x-1)^3*( 1+x+x^2)^3), x, n+1), x, n), n = 1 ..80); # G. C. Greubel, Nov 19 2019
MATHEMATICA
Rest@CoefficientList[Series[x*(-1-3*x-x^2+2*x^3+4*x^4-2*x^5-x^6-x^7+x^8 )/((x-1)^3*(1+x+x^2)^3), {x, 0, 80}], x] (* G. C. Greubel, Nov 19 2019 *)
LinearRecurrence[{0, 0, 3, 0, 0, -3, 0, 0, 1}, {1, 3, 1, 1, 5, 5, 1, 7, 11}, 80] (* Harvey P. Dale, Jan 16 2024 *)
PROG
(PARI) my(x='x+O('x^80)); Vec(x*(-1-3*x-x^2+2*x^3+4*x^4-2*x^5-x^6-x^7+ x^8)/((x-1)^3*(1+x+x^2)^3)) \\ G. C. Greubel, Nov 19 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 80); Coefficients(R!( x*(-1-3*x-x^2+2*x^3+4*x^4-2*x^5-x^6-x^7+x^8)/((x-1)^3*(1+x+x^2)^3) )); // G. C. Greubel, Nov 19 2019
(Sage)
def A124925_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P(x*(-1-3*x-x^2+2*x^3+4*x^4-2*x^5-x^6-x^7+x^8)/((x-1)^3*(1+x+x^2)^3)).list()
a=A124925_list(80); a[1:] # G. C. Greubel, Nov 19 2019
(GAP) a:=[1, 3, 1, 1, 5, 5, 1, 7, 11];; for n in [10..80] do a[n]:=3*a[n-3]-3*a[n-6]+a[n-9]; od; a; # G. C. Greubel, Nov 19 2019
CROSSREFS
KEYWORD
nonn,easy,less
AUTHOR
Gary W. Adamson, Nov 12 2006
EXTENSIONS
Edited and extended by R. J. Mathar, Mar 28 2010
STATUS
approved