A290968 a(n) = a(n-1) + a(n-2) - a(n-3) + a(n-4) + a(n-5), with a(0)=a(1)=a(2)=1, a(3)=-1 and a(4)=1.
1, 1, 1, -1, 1, 1, 5, 5, 9, 11, 21, 33, 57, 89, 145, 231, 377, 609, 989, 1597, 2585, 4179, 6765, 10945, 17713, 28657, 46369, 75023, 121393, 196417, 317813, 514229, 832041, 1346267, 2178309, 3524577, 5702889, 9227465, 14930353, 24157815
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1,1,-1,1,1).
Programs
-
Magma
R
:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1-x^2-2*x^3+x^4)/((1+x^3)*(1-x-x^2)) )); // G. C. Greubel, Jun 11 2019 -
Mathematica
LinearRecurrence[{1,1,-1,1,1}, {1,1,1,-1,1}, 40]
-
PARI
my(x='x+O('x^40)); Vec((1-x^2-2*x^3+x^4)/((1+x^3)*(1-x-x^2))) \\ G. C. Greubel, Jun 11 2019
-
Sage
((1-x^2-2*x^3+x^4)/((1+x^3)*(1-x-x^2))).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Jun 11 2019
Formula
G.f.: (1-x^2-2*x^3+x^4)/((1+x)*(1-x+x^2)*(1-x-x^2)).
a(n) ~ phi^(n-2)/sqrt(5), where phi is the golden ratio.
a(n) = (1/2 + sqrt(5)/2)^n*(3*sqrt(5)/10-1/2) - (-1/2 + sqrt(5)/2)^n*(3*sqrt(5)/10 + 1/2)*(-1)^n + 2*sqrt(3)*sin(Pi*(n/3 + 1/3))/3 + (-1)^n. - Eric Simon Jacob, Jul 11 2024
Comments