OFFSET
0,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (5,-3,-1).
FORMULA
a(n) = n, for n<2.
G.f.: x*(1 - 6*x^2 - x^3)/((1 - x)*(1 - 4*x - x^2)). - Stefano Spezia, Sep 25 2023
EXAMPLE
a(0) = 0, the sum of 0 Lucas numbers.
a(1) = 1 = A000032(1), the sum of 1 Lucas number.
a(2) = 5 = 1+4 = A000032(1)+A000032(3), the sum of 2 Lucas numbers. (2, 3, and 4 need only one term, since they are Lucas numbers.)
a(4) = 63 = 1+4+11+47.
For comparison, 45 is the first sum requiring 4 positive Lucas numbers (45 = 1+4+11+29, see A004146), but here 45 = 47+2-4 requires only 3 signed Lucas numbers so that a(4) != 45.
MATHEMATICA
LinearRecurrence[{5, -3, -1}, {0, 1, 5, 16, 63}, 26] (* Amiram Eldar, Sep 26 2023 *)
PROG
(Python)
from sympy import lucas
a = lambda n: n if n<2 else (lucas(3*n-2)+3)//2
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Mike Speciner, Sep 22 2023
STATUS
approved