OFFSET
1,2
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..100
FORMULA
a(n) = A328597(n) + 1 for n > 1. - Andrew Howroyd, Oct 27 2019
EXAMPLE
The a(7) = 13 cyclic compositions with adjacent parts coprime:
7,
16, 25, 34,
115,
1114, 1213, 1132, 1123,
11113, 11212,
111112,
1111111.
MATHEMATICA
neckQ[q_]:=Array[OrderedQ[{q, RotateRight[q, #]}]&, Length[q]-1, 1, And];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], Or[Length[#]==1, neckQ[#]&&And@@CoprimeQ@@@Partition[#, 2, 1, 1]]&]], {n, 20}]
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, (n > 1) + sumdiv(n, d, eulerphi(d)*v[n/d])/n)} \\ Andrew Howroyd, Oct 27 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Sep 02 2018
EXTENSIONS
Terms a(21) and beyond from Andrew Howroyd, Sep 08 2018
Name corrected by Gus Wiseman, Nov 04 2019
STATUS
approved