OFFSET
3,1
COMMENTS
All values are even since the parts must alternate between even and odd and therefore a composition is never equal to its reversal.
The longest compositions will consist of alternating 1's and 2's. The number of parts cannot then exceed n / 3.
EXAMPLE
Triangle begins:
2;
0;
2;
0, 2;
2, 0;
0, 4;
2, 0, 2;
0, 2, 0;
2, 0, 6;
0, 4, 0, 2;
2, 0, 6, 0;
0, 2, 0, 8;
2, 0, 8, 0, 2;
0, 4, 0, 12, 0;
2, 0, 6, 0, 10;
0, 2, 0, 16, 0, 2;
2, 0, 6, 0, 20, 0;
0, 4, 0, 18, 0, 12;
2, 0, 8, 0, 30, 0, 2;
0, 2, 0, 16, 0, 30, 0;
2, 0, 6, 0, 40, 0, 14;
0, 4, 0, 20, 0, 52, 0, 2;
2, 0, 6, 0, 42, 0, 42, 0;
0, 2, 0, 16, 0, 78, 0, 16;
2, 0, 8, 0, 50, 0, 84, 0, 2;
0, 4, 0, 18, 0, 96, 0, 56, 0;
2, 0, 6, 0, 50, 0, 140, 0, 18;
0, 2, 0, 16, 0, 116, 0, 128, 0, 2;
...
For n = 11 there are a total of 8 compositions:
k = 1: (56), (65)
k = 3: (121232), (123212), (212123), (212321), (232121), (321212)
PROG
(PARI)
step(R, n)={matrix(n, n, i, j, if(i>j, if(j>1, R[i-j, j-1]) + if(j+1<=n, R[i-j, j+1])))}
T(n)={my(v=vector(n\3)); for(k=1, n, my(R=matrix(n, n, i, j, i==j&&abs(i-k)==1), m=0); while(R, m++; if(m%2==0, v[m/2]+=R[n, k]); R=step(R, n))); v}
for(n=3, 24, print(T(n)))
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Andrew Howroyd, Aug 23 2019
STATUS
approved