OFFSET
0,2
LINKS
Paolo Xausa, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,2,1,-1).
FORMULA
a(n) = 2*a(n-2) + a(n-3) - a(n-4).
G.f.: ((1+x)*(1+2*x+x^2-x^3))/(1-2*x^2-x^3+x^4).
EXAMPLE
For n=3 the a(3)=7 solutions are 012, 020, 120, 121, 201, 202, 212.
MATHEMATICA
LinearRecurrence[{0, 2, 1, -1}, {1, 3, 5, 7, 11}, 50] (* Paolo Xausa, Jan 19 2026 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Miquel A. Fiol, Jun 09 2024
STATUS
approved
