A325558
Number of compositions of n with equal circular differences up to sign.
Original entry on oeis.org
1, 2, 4, 5, 6, 10, 8, 16, 13, 16, 18, 32, 20, 30, 30, 57, 34, 52, 46, 96, 74, 86, 84, 174, 119, 170, 192, 306, 244, 332, 372, 628, 560, 694, 812, 1259, 1228, 1566, 1852, 2696, 2806, 3538, 4260, 5894, 6482, 8098, 9890, 13392, 15049, 18706, 23018, 30298, 35198
Offset: 1
The a(1) = 1 through a(8) = 16 compositions:
(1) (2) (3) (4) (5) (6) (7) (8)
(11) (12) (13) (14) (15) (16) (17)
(21) (22) (23) (24) (25) (26)
(111) (31) (32) (33) (34) (35)
(1111) (41) (42) (43) (44)
(11111) (51) (52) (53)
(222) (61) (62)
(1212) (1111111) (71)
(2121) (1232)
(111111) (1313)
(2123)
(2222)
(2321)
(3131)
(3212)
(11111111)
Cf.
A000079,
A008965,
A047966,
A049988,
A098504,
A173258,
A175342,
A325553,
A325557,
A325588,
A325589.
-
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],SameQ@@Abs[Differences[Append[#,First[#]]]]&]],{n,15}]
-
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])) )}
w(n,k,s)={my(R=matrix(n,n,i,j,i==j&&abs(i-k)==s), t=0); while(R, R=step(R,n,s); t+=R[n,k]); t}
a(n) = {numdiv(max(1,n)) + sum(s=1, n-1, sum(k=1, n, w(n,k,s)))} \\ Andrew Howroyd, Aug 22 2019
A325590
Number of necklace compositions of n with circular differences all equal to 1 or -1.
Original entry on oeis.org
0, 0, 1, 0, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 4, 3, 3, 4, 4, 5, 7, 6, 7, 10, 10, 11, 15, 16, 18, 23, 25, 32, 38, 43, 53, 64, 73, 89, 108, 131, 153, 188, 223, 272, 329, 395, 475, 583, 697, 848, 1027, 1247, 1506, 1837, 2223, 2708, 3282, 3993, 4848, 5913, 7175, 8745, 10640
Offset: 1
The first 16 terms count the following compositions:
3: (12)
5: (23)
6: (1212)
7: (34)
8: (1232)
9: (45)
9: (121212)
10: (2323)
11: (56)
11: (121232)
12: (2343)
12: (12121212)
13: (67)
13: (123232)
14: (3434)
14: (12121232)
15: (78)
15: (123432)
15: (232323)
15: (1212121212)
16: (3454)
16: (12321232)
16: (12123232)
The a(21) = 7 necklace compositions:
(10,11)
(2,3,4,5,4,3)
(3,4,3,4,3,4)
(1,2,1,2,1,2,3,4,3,2)
(1,2,3,2,1,2,3,2,3,2)
(1,2,1,2,3,2,3,2,3,2)
(1,2,1,2,1,2,1,2,1,2,1,2,1,2)
-
neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],neckQ[#]&&(SameQ[1,##]&@@Abs[Differences[Append[#,First[#]]]])&]],{n,15}]
-
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, m=1); while(R, R=step(R,n,1); m++; t+=sumdiv(n, d, R[d,k]*d*eulerphi(n/d))/m ); t/n)} \\ Andrew Howroyd, Aug 23 2019
A325556
Number of necklace compositions of n with distinct circular differences up to sign.
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 3, 7, 9, 13, 25, 27, 51, 63, 95, 123, 179, 205, 305, 409, 559, 715, 1009, 1337, 1869
Offset: 1
The a(1) = 1 through a(10) = 13 necklace compositions:
(1) (2) (3) (4) (5) (6) (7) (8) (9) (A)
(124) (125) (126) (127)
(142) (134) (162) (136)
(143) (1125) (145)
(152) (1134) (154)
(1124) (1143) (163)
(1142) (1152) (172)
(1224) (235)
(1422) (253)
(1126)
(1162)
(1225)
(1522)
Cf.
A000079,
A000740,
A008965,
A235998,
A318728,
A325324,
A325325,
A325349,
A325549,
A325553,
A325555,
A325588,
A325590.
-
neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Abs[Differences[Append[#,First[#]]]]&&neckQ[#]&]],{n,15}]
Showing 1-3 of 3 results.
Comments