OFFSET
0,4
COMMENTS
Called Leonardo 2-numbers in the Tan-Leung paper.
LINKS
Elif Tan and Ho-Hon Leung, On Leonardo p-Numbers, Integers (2023) Vol. 23, #A7. See p. 2.
Index entries for linear recurrences with constant coefficients, signature (2,-1,1,-1).
FORMULA
From Elmo R. Oliveira, Apr 01 2026: (Start)
G.f.: (2*x^3 - x + 1)/((x^3 + x - 1)*(x - 1)).
a(n) = 2*a(n-1) - a(n-2) + a(n-3) - a(n-4). (End)
MATHEMATICA
LinearRecurrence[{2, -1, 1, -1}, {1, 1, 1, 4}, 40] (* or *)
With[{k = 2}, Nest[Append[#, #[[-1]] + #[[-k - 1]] + k] &, {1, 1, 1}, 40] ]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michael De Vlieger, Apr 13 2023
STATUS
approved
