OFFSET
1,4
COMMENTS
A Lyndon composition of n is a finite sequence of positive integers summing to n that is lexicographically strictly less than all of its cyclic rotations.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..200
FORMULA
a(n > 1) = A318745(n) - 1.
EXAMPLE
The a(1) = 1 through a(8) = 18 Lyndon compositions (empty column not shown):
(1) (12) (13) (14) (15) (16) (17)
(112) (23) (114) (25) (35)
(113) (123) (34) (116)
(1112) (132) (115) (125)
(1113) (1114) (134)
(11112) (1123) (143)
(1132) (152)
(1213) (1115)
(11113) (1214)
(11212) (1232)
(111112) (11114)
(11123)
(11132)
(11213)
(11312)
(111113)
(111212)
(1111112)
MATHEMATICA
aperQ[q_]:=Array[RotateRight[q, #]&, Length[q], 1, UnsameQ];
neckQ[q_]:=Array[OrderedQ[{q, RotateRight[q, #]}]&, Length[q]-1, 1, And];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], aperQ[#]&&neckQ[#]&&And@@CoprimeQ@@@Partition[#, 2, 1, 1]&]], {n, 10}]
PROG
(PARI)
b(n, q, pred)={my(M=matrix(n, n)); for(k=1, n, M[k, k]=pred(q, k); for(i=1, k-1, M[i, k]=sum(j=1, k-i, if(pred(j, i), M[j, k-i], 0)))); M[q, ]}
seq(n)={my(v=sum(k=1, n, k*b(n, k, (i, j)->gcd(i, j)==1))); vector(n, n, sumdiv(n, d, moebius(d)*v[n/d])/n)} \\ Andrew Howroyd, Nov 01 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Oct 26 2019
STATUS
approved