login
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, 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,7
COMMENTS
The array of successive differences begins:
1, 1, 1, -1, 1, 1, 5, 5, 9, 11, 21, 33, 57, ...
0, 0, -2, 2, 0, 4, 0, 4, 2, 10, 12, 24, 32, ...
0, -2, 4, -2, 4, -4, 4, -2, 8, 2, 12, 8, 24, ...
-2, 6, -6, 6, -8, 8, -6, 10, -6, 10, -4, 16, 6, ...
8, -12, 12, -14, 16, -14, 16, -16, 16, -14, 20, -10, 24, ...
...
First row is a(n) = 2*A141325(n) - A141325(n+1).
Main diagonal is A099430(n).
The first upper subdiagonal, 1, -2, -2, -8, -14, ..., has -3*A078008(n) as first differences.
The second upper subdiagonal is A000079(n) = 2^n.
a(n) is related to Fibonacci numbers a(n) = A000045(n-2) + period 6: repeat [2, 0, 1, -2, 0, -1].
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
MATHEMATICA
LinearRecurrence[{1, 1, -1, 1, 1}, {1, 1, 1, -1, 1}, 40]
PROG
(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
(Magma) R<x>:=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
(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
CROSSREFS
KEYWORD
easy,sign
AUTHOR
STATUS
approved