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,4,-1,-1).
FORMULA
From G. C. Greubel, Jul 11 2023: (Start)
a(n) = (1/2)*Sum_{j=0..n} T(n, j)*A078008(j), where T(n, k) = [x^k] ((x + sqrt(x^2+4))^n + (x - sqrt(x^2+4))^n)/2^n.
a(n) = a(n-1) + 4*a(n-2) - a(n-3) - a(n-4).
G.f.: (1+x)*(1-2*x)/((1+x-x^2)*(1-2*x-x^2)). (End)
EXAMPLE
MATHEMATICA
(See A192423.)
LinearRecurrence[{1, 4, -1, -1}, {1, 0, 2, 1}, 40] (* G. C. Greubel, Jul 12 2023 *)
PROG
(Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1+x)*(1-2*x)/((1+x-x^2)*(1-2*x-x^2)) )); // G. C. Greubel, Jul 12 2023
(SageMath)
@CachedFunction
def a(n): # a = A192424
if (n<4): return (1, 0, 2, 1)[n]
else: return a(n-1) +4*a(n-2) -a(n-3) -a(n-4)
[a(n) for n in range(41)] # G. C. Greubel, Jul 12 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jun 30 2011
STATUS
approved