OFFSET
1,3
COMMENTS
These are integer compositions such that no adjacent parts are equal and their set of parts covers some interval.
EXAMPLE
a(6) = 9 counts: (1,2,1,2), (2,1,2,1), (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), (3,2,1), (6).
PROG
(PARI)
Ca_x(s, N)={my(x='x+O('x^N), g=if(#s <1, 1, sum(i=1, #s, (Ca_x(s[^i], N) * x^(s[i])/(1+x^(s[i]))))/(1-sum(i=1, #s, (x^(s[i]))/(1+x^(s[i])))))); return(g)}
B_x(N)={my(x='x+O('x^N), j=1, h=0); while((j*(j+1))/2 <= N, for(k=0, N, h += Ca_x([(1+k)..(j+k)], N+1)); j++); my(a = Vec(h)); vector(N, i, a[i])}
B_x(20)
CROSSREFS
KEYWORD
nonn
AUTHOR
John Tyler Rascoe, Jul 17 2024
STATUS
approved