OFFSET
1,3
COMMENTS
A composition of n is a finite sequence of positive integers summing to n.
The circular differences of a composition c of length k are c_{i + 1} - c_i for i < k and c_1 - c_i for i = k. For example, the circular differences of (1,2,1,3) are (1,-1,2,-2).
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..200
EXAMPLE
The a(3) = 2 through a(11) = 8 compositions (empty columns not shown):
(12) (23) (1212) (34) (1232) (45) (2323) (56)
(21) (32) (2121) (43) (2123) (54) (3232) (65)
(2321) (121212) (121232)
(3212) (212121) (123212)
(212123)
(212321)
(232121)
(321212)
MATHEMATICA
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], SameQ[1, ##]&@@Abs[Differences[Append[#, First[#]]]]&]], {n, 15}]
PROG
(PARI)
step(R, n, s)={matrix(n, n, i, j, if(i>j, if(j>s, R[i-j, j-s]) + if(j+s<=n, R[i-j, j+s])) )}
a(n)={sum(k=1, n, my(R=matrix(n, n, i, j, i==j&&abs(i-k)==1), t=0); while(R, R=step(R, n, 1); t+=R[n, k]); t)} \\ Andrew Howroyd, Aug 23 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, May 11 2019
EXTENSIONS
Terms a(26) and beyond from Andrew Howroyd, Aug 23 2019
STATUS
approved