OFFSET
0,4
COMMENTS
A composition of n is a finite sequence of positive integers summing to n.
A circular subinterval is a sequence of consecutive indices where the first and last indices are also considered consecutive.
For n > 0, a(n) is the number of subsets of Z_n which contain 0 and such that every ordered pair of distinct elements has a different difference (modulo n). The elements of a subset correspond with the partial sums of a composition. For example, when n = 8 the subset {0,2,7} corresponds with the composition (251). - Andrew Howroyd, Mar 24 2025
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..80
EXAMPLE
The a(1) = 1 through a(8) = 13 compositions:
(1) (2) (3) (4) (5) (6) (7) (8)
(12) (13) (14) (15) (16) (17)
(21) (31) (23) (24) (25) (26)
(32) (42) (34) (35)
(41) (51) (43) (53)
(52) (62)
(61) (71)
(124) (125)
(142) (152)
(214) (215)
(241) (251)
(412) (512)
(421) (521)
MATHEMATICA
suball[q_]:=Join[Take[q, #]&/@Select[Tuples[Range[Length[q]], 2], OrderedQ], Drop[q, #]&/@Select[Tuples[Range[2, Length[q]-1], 2], OrderedQ]];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], UnsameQ@@Total/@suball[#]&]], {n, 0, 15}]
PROG
(PARI)
a(n)={
my(recurse(k, b, w)=
if(k >= n, 1,
b+=1<<k;
my(t=bitand((1<<n)-1, bitor(b<<k, b<<(k-n))));
if(k, self()(k+1, b-(1<<k), w)) +
if(!bitand(w, t), self()(k+1, b, w + t));
));
recurse(0, 0, 0);
} \\ Andrew Howroyd, Mar 24 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, May 13 2019
EXTENSIONS
a(21) onwards from Andrew Howroyd, Mar 24 2025
STATUS
approved
