OFFSET
0,3
COMMENTS
In other words, there is no restriction on the length of runs of 1's, the length of runs of 2's must be at least two, the length of runs of 3's must be at least three...
a(n) is the number of n-color integer compositions of n such that no adjacent parts are the same color. - John Tyler Rascoe, Jul 23 2024
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
FORMULA
G.f.: 1/(1 - Sum_{i>0} x^i/(1 - x + x^i)). - John Tyler Rascoe, Jul 23 2024
EXAMPLE
a(3)=5 because we have: 111, 122, 221, 222, 333.
a(4)=11 because we have: 1111, 1122, 1221, 1222, 2211, 2221, 2222, 3331, 1333, 3333, 4444.
MAPLE
b:= proc(n, t) option remember; `if`(n=0, 1,
`if`(t=0, 0, b(n-1, t)) +add(
`if`(t=j, 0, b(n-j, j)), j=1..n))
end:
a:= n-> b(n, 0):
seq(a(n), n=0..40); # Alois P. Heinz, Oct 07 2015
MATHEMATICA
n=nn=35; CoefficientList[Series[1/(1-Sum[v[i]/(1+v[i])/.v[i]->z^i/(1-z), {i, 1, n}]), {z, 0, nn}], z]
PROG
(PARI)
C_x(N)={my(x='x+O('x^N), h = 1/(1-sum(i=1, N, x^i/(1 - x + x^i)))); Vec(h)}
C_x(40) \\ John Tyler Rascoe, Jul 23 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Geoffrey Critzer, May 17 2014
STATUS
approved