OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (5,-10,10,-5,1).
FORMULA
a(n) = (((n + 10)*n + 35)*n + 26)*n/24 + 1.
G.f.: -(x^4 - 3*x^3 + 3*x^2 - x + 1)/(x - 1)^5.
a(n) = 1 + A005718(n-1) for n>=1.
EXAMPLE
For n=2, the 13 strings are all possible 2-character strings of '0', '1', '2' and '3' except the four strings '33', '32', '23'.
MATHEMATICA
f[n_, r_, l_] := If[r < 0, 0, If[r==0, 1, If[l < 0, 0, If[l == 0, 1, Sum[f[n, r-j, l-1], {j, 0, n}]]]]]; Table[f[3, 4, x], {x, 0, 40}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Daniel T. Martin, May 23 2023
STATUS
approved