OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,0,1,-1,-1).
FORMULA
G.f.: (1 + x^3 - x^4 + x^5 + x^7)/((1-x^4)*(1-x-x^2)).
From G. C. Greubel, Jun 21 2024: (Start)
a(n) = (1/20)*(2*LucasL(n-1) + 70*Fibonacci(n-1) - 15*(1+(-1)^n) - 4*cos((n-1)*Pi/2) - 2*sin((n-1)*Pi/2)) - [n=0] + [n=1].
E.g.f.: (1/10)*(cos(x) - 2*sin(x) - 15*cosh(x) - 10*(1 - x) + 2*exp(x/2)*(17*cosh(sqrt(5)*x/2) - 3*sqrt(5)*sinh(sqrt(5)*x/2))). (End)
MATHEMATICA
LinearRecurrence[{1, 1, 0, 1, -1, -1}, {1, 1, 2, 4, 6, 11, 17, 30}, 41] (* G. C. Greubel, Jun 21 2024 *)
PROG
(Magma) I:=[2, 4, 6, 11, 17, 30]; [1, 1] cat [n le 6 select I[n] else Self(n-1) +Self(n-2) +Self(n-4) -Self(n-5) -Self(n-6): n in [1..50]]; // G. C. Greubel, Jun 21 2024
(SageMath)
@CachedFunction
def a(n): # a = A026636
if n<8: return (1, 1, 2, 4, 6, 11, 17, 30)[n]
else: return a(n-1) +a(n-2) +a(n-4) -a(n-5) -a(n-6)
[a(n) for n in range(41)] # G. C. Greubel, Jun 21 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved