OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (7,-21,35,-35,21,-7,1).
FORMULA
a(n) = 60*binomial(n,6) + 10*binomial(n,5) + 4*binomial(n,4) + 4*binomial(n,3) + binomial(n,2) + n + 1.
a(n) = 1 - (43/6)*n + 19*n^2 - (97/6)*n^3 + (77/12)*n^4 - (7/6)*n^5 + (1/12)*n^6.
G.f.: (51*x^6 + 9*x^5 + 3*x^4 - 10*x^3 + 11*x^2 - 5*x + 1)/(1-x)^7.
E.g.f.: exp(x)*(1+x)*(1+x^2/2)*(1+x^3/6).
EXAMPLE
a(2) = 4 since the strings are 01, 10, 22, 00.
a(3) = 11 since the strings are 333, 000, the 3 permutations of 122, the 3 permutations of 100, and the 3 permutations of 220.
MATHEMATICA
LinearRecurrence[{7, -21, 35, -35, 21, -7, 1}, {1, 2, 4, 11, 31, 86, 282}, 36] (* Amiram Eldar, Jun 28 2025 *)
PROG
(Python)
def A385407(n): return n*(n*(n*(n*(n*(n-14)+77)-194)+228)-86)//12+1 # Chai Wah Wu, Jul 02 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, Jun 27 2025
STATUS
approved
