A001371
Number of n-bead necklaces with beads of 2 colors and primitive period n, when turning over is allowed.
Original entry on oeis.org
1, 2, 1, 2, 3, 6, 8, 16, 24, 42, 69, 124, 208, 378, 668, 1214, 2220, 4110, 7630, 14308, 26931, 50944, 96782, 184408, 352450, 675180, 1296477, 2493680, 4805388, 9272778, 17919558, 34669600, 67156800, 130215996, 252741255, 490984464, 954629662, 1857545298
Offset: 0
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence, in two entries, N0045 and N0285).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- T. D. Noe, Table of n, a(n) for n = 0..400
- Jairo Bochi and Piotr Laskawiec, Spectrum maximizing products are not generically unique, arXiv:2301.12574 [math.OC], 2023.
- Edgar N. Gilbert and John Riordan, Symmetry types of periodic sequences, Illinois J. Math., 5 (1961), 657-665.
- Piotr Laskawiec, Joint Spectral Radius with focus on pairs of 2 X 2 matrices, Ph. D. Dissertation, Penn. State Univ. (2025). See p. 55.
- Frank Ruskey, Necklaces, Lyndon words, De Bruijn sequences, etc.
- Frany Ruskey, Necklaces, Lyndon words, De Bruijn sequences, etc. [Cached copy, with permission, pdf format only]
- Index entries for sequences related to necklaces
-
with(numtheory); A001371 := proc(n) local s,d; if n = 0 then RETURN(1) else s := 0; for d in divisors(n) do s := s+mobius(d)*A000029(n/d); od; RETURN(s); fi; end;
-
a29[n_] := a29[n] = (s = If[OddQ[n], 2^((n-1)/2) , 2^(n/2 - 2) + 2^(n/2 - 1)]; a29[0] = 1; Do[s = s + EulerPhi[d]*2^(n/d)/(2*n), {d, Divisors[n]}]; s); a[n_] := Sum[ MoebiusMu[d]*a29[n/d], {d, Divisors[n]}]; a[0] = 1; Table[ a[n], {n, 0, 34}] (* Jean-François Alcover, Oct 04 2011 *)
mx=40;gf[x_,k_]:=Sum[ MoebiusMu[n]*(-Log[1-k*x^n]/n+Sum[Binomial[k,i]x^(n i),{i,0,2}]/( 1-k x^(2n)))/2,{n,mx}]; ReplacePart[CoefficientList[Series[gf[x,2],{x,0,mx}],x],1->1] (* Herbert Kociemba, Nov 28 2016 *)
-
from sympy import divisors, totient, mobius
def a000029(n):
return 1 if n<1 else ((2**(n//2+1) if n%2 else 3*2**(n//2-1)) + sum(totient(n//d)*2**d for d in divisors(n))//n)//2
def a(n):
return 1 if n<1 else sum(mobius(d)*a000029(n//d) for d in divisors(n))
print([a(n) for n in range(51)]) # Indranil Ghosh, Apr 23 2017
A032164
Number of aperiodic necklaces of n beads of 6 colors; dimensions of free Lie algebras.
Original entry on oeis.org
1, 6, 15, 70, 315, 1554, 7735, 39990, 209790, 1119720, 6045837, 32981550, 181394535, 1004668770, 5597420295, 31345665106, 176319264240, 995685849690, 5642219252460, 32071565263710, 182807918979777
Offset: 0
- M. Lothaire, Combinatorics on Words. Addison-Wesley, Reading, MA, 1983, p. 79.
- Seiichi Manyama, Table of n, a(n) for n = 0..1289 (terms 0..200 from T. D. Noe)
- C. G. Bower, Transforms (2)
- E. N. Gilbert and J. Riordan, Symmetry types of periodic sequences, Illinois J. Math., 5 (1961), 657-665.
- Y. Puri and T. Ward, Arithmetic and growth of periodic orbits, J. Integer Seqs., Vol. 4 (2001), #01.2.1.
- F. Ruskey, Necklaces, Lyndon words, De Bruijn sequences, etc.
- F. Ruskey, Necklaces, Lyndon words, De Bruijn sequences, etc. [Cached copy, with permission, pdf format only]
- G. Viennot, Algèbres de Lie Libres et Monoïdes Libres, Lecture Notes in Mathematics 691, Springer Verlag 1978.
- Index entries for sequences related to Lyndon words
-
f[d_] := MoebiusMu[d]*6^(n/d)/n; a[n_] := Total[f /@ Divisors[n]]; a[0] = 1; Table[a[n], {n, 0, 20}](* Jean-François Alcover, Nov 07 2011 *)
mx=40;f[x_,k_]:=1-Sum[MoebiusMu[i] Log[1-k*x^i]/i,{i,1,mx}];CoefficientList[Series[f[x,6],{x,0,mx}],x] (* Herbert Kociemba, Nov 25 2016 *)
-
a(n) = if (n==0, 1, sumdiv(n, d, moebius(d)*6^(n/d)/n)); \\ Michel Marcus, Dec 01 2015
A072605
Number of necklaces with n beads over an n-ary alphabet {a1,a2,...,an} such that #(w,a1) >= #(w,a2) >= ... >= #(w,ak) >= 0, where #(w,x) counts the letters x in word w.
Original entry on oeis.org
1, 1, 2, 4, 13, 50, 270, 1641, 11945, 96784, 887982, 8939051, 99298354, 1195617443, 15619182139, 219049941201, 3293800835940, 52746930894774, 897802366250126, 16167544246362567, 307372573011579188, 6148811682561390279, 129164845357784003661
Offset: 0
- Alois P. Heinz, Table of n, a(n) for n = 0..200
- Frank Ruskey, Necklaces, Lyndon words, De Bruijn sequences, etc.
- F. Ruskey, Necklaces, Lyndon words, De Bruijn sequences, etc. [Cached copy, with permission, pdf format only]
- Eric Weisstein's world of Mathematics, Necklaces
-
neck[li:{__Integer}] := Module[{n, d}, n=Plus@@li; d=n-First[li]; Fold[ #1+(EulerPhi[ #2]*(n/#2)!)/Times@@((li/#2)!)&, 0, Divisors[GCD@@li]]/n]; Table[ Plus@@(neck /@ IntegerPartitions[n]), {n, 24}]
-
a(n)={if(n==0, 1, my(p=prod(k=1, n, 1/(1-x^k/k!) + O(x*x^n))); sumdiv(n, d, eulerphi(n/d)*d!*polcoeff(p,d))/n)} \\ Andrew Howroyd, Dec 20 2017
A123045
Number of frieze patterns of length n under a certain group (see Pisanski et al. for precise definition).
Original entry on oeis.org
0, 2, 6, 12, 39, 104, 366, 1172, 4179, 14572, 52740, 190652, 700274, 2581112, 9591666, 35791472, 134236179, 505290272, 1908947406, 7233629132, 27488079132, 104715393912, 399823554006, 1529755308212, 5864066561554, 22517998136936, 86607703209516
Offset: 0
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
- Shinsaku Fujita, alpha-beta Itemized Enumeration of Inositol Derivatives and m-Gonal Homologs by Extending Fujita's Proligand Method, Bull. Chem. Soc. Jpn. 2017, 90, 343-366; doi:10.1246/bcsj.20160369. See Table 8.
- T. Pisanski, D. Schattschneider and B. Servatius, Applying Burnside's lemma to a one-dimensional Escher problem, Math. Mag., 79 (2006), 167-180. See F(n).
-
with(numtheory):
V:=proc(n) local k, t1; t1:=0; for k in divisors(n) do t1 := t1+phi(k)*4^(n/k); od: t1; end; # A054611
H:=n-> if n mod 2 = 0 then (n/2)*4^(n/2); else 0; fi; # this is A018215 interleaved with 0's
A123045:=n-> `if`(n=0,0, (V(n)+H(n))/(2*n));
-
V[n_] := Module[{t1 = 0}, Do[t1 = t1 + EulerPhi[k] 4^(n/k), {k, Divisors[n]}]; t1];
H[n_] := If[Mod[n, 2] == 0, (n/2) 4^(n/2), 0];
a[n_] := If[n == 0, 0, (V[n] + H[n])/(2n)];
a /@ Range[0, 26] (* Jean-François Alcover, Mar 20 2020, from Maple *)
A166316
Lexicographically largest binary de Bruijn sequences, B(2,n).
Original entry on oeis.org
2, 12, 232, 63056, 4221224224, 18295693635288736320, 338921575014037816709507133224870496384, 115563265193225535967792084153637585725267224878335215248443107599191173632256
Offset: 1
For n = 3, the last de Bruijn sequence, a(n) = B(2,3), is '11101000' = 232.
- Darse Billings, Table of n, a(n) for n=1..9
- Darse Billings, Python program
- F. Ruskey, Necklaces, Lyndon words, De Bruijn sequences, etc.
- F. Ruskey, Necklaces, Lyndon words, De Bruijn sequences, etc. [Cached copy, with permission, pdf format only]
- Eric Weisstein's World of Mathematics, de Bruijn Sequence
- Wikipedia, de Bruijn Sequence
Cf.
A166315 (lexicographically earliest de Bruijn sequences (binary complements)).
A283846
Number of n-gonal inositol homologs with 2 kinds of achiral proligands.
Original entry on oeis.org
2, 6, 10, 31, 68, 226, 650, 2259, 7542, 27036, 96350, 352786, 1294652, 4806366, 17912120, 67160083, 252710672, 954641186, 3617076710, 13744708060, 52358745532, 199914446106, 764881848410, 2932043941394, 11259015845684, 43303894193076, 166800053312630
Offset: 1
- Robert Israel, Table of n, a(n) for n = 1..1665
- Shinsaku Fujita, alpha-beta Itemized Enumeration of Inositol Derivatives and m-Gonal Homologs by Extending Fujita's Proligand Method, Bull. Chem. Soc. Jpn. 2017, 90, 343-366; doi:10.1246/bcsj.20160369. See Table 8.
- Yi Hu, Numerical Transfer Matrix Method of Next-nearest-neighbor Ising Models, Master's Thesis, Duke Univ. (2021).
- Yi Hu and Patrick Charbonneau, Numerical transfer matrix study of frustrated next-nearest-neighbor Ising models on square lattices, arXiv:2106.08442 [cond-mat.stat-mech], 2021.
-
f:= proc(m) uses numtheory;
if m::even then 1/(4*m)*add(phi(d)*4^(m/d)*`if`(d::even,2,1), d = divisors(m))
+ 3*2^(m-2)
else
1/(4*m)*add(phi(d)*4^(m/d),d=divisors(m))+2^(m-1)
fi
end proc:
map(f, [$1..100]); # Robert Israel, Aug 21 2018
-
f[m_] := If[EvenQ[m], 1/(4m)*Sum[EulerPhi[d]*4^(m/d)*If[EvenQ[d], 2, 1], {d, Divisors[m]}]+ 3*2^(m-2), 1/(4m)*Sum[EulerPhi[d]*4^(m/d), {d, Divisors[m]}] + 2^(m-1)];
f /@ Range[1, 25] (* Jean-François Alcover, Feb 26 2019, after Robert Israel *)
A283847
Number of n-gonal inositol homologs with 2 kinds of achiral proligands.
Original entry on oeis.org
2, 8, 36, 140, 522, 1920, 7030, 25704, 94302, 347488, 1286460, 4785300, 17879352, 67076096, 252579600, 954306220, 3616552422, 13743371072, 52356648380, 199909107900, 764873459802, 2932022620160, 11258982291252, 43303809016440, 166799919094902, 643371241120928
Offset: 3
-
f:= proc(n) uses numtheory;
if n::even then (4*n)^(-1)*add(phi(d)*4^(n/d), d = select(type,divisors(n),odd)) - 2^(n-1)
else (4*n)^(-1)*add(phi(d)*4^(n/d), d = divisors(n)) - 2^(n-1)
fi
end proc:
map(f, [$3..50]); # Robert Israel, Aug 23 2018
-
a[n_] := If[EvenQ[n], (4n)^(-1) Sum[EulerPhi[d] 4^(n/d), {d, Select[ Divisors[n], OddQ]}] - 2^(n-1), (4n)^(-1) Sum[EulerPhi[d] 4^(n/d), {d, Divisors[n]}] - 2^(n-1)];
Table[a[n], {n, 3, 50}] (* Jean-François Alcover, Mar 23 2019, after Robert Israel *)
A283848
Number of n-gonal inositol homologs with 2 kinds of achiral proligands.
Original entry on oeis.org
8, 23, 32, 86, 128, 339, 512, 1332, 2048, 5298, 8192, 21066, 32768, 83987, 131072, 334966, 524288, 1336988, 2097152, 5338206, 8388608, 21321234, 33554432, 85176636, 134217728, 340338398, 536870912, 1360073016, 2147483648, 5435820051, 8589934592, 21727481616, 34359738368, 86853790498, 137438953472
Offset: 3
-
f:= proc(n) uses numtheory;
if n::even then (2*n)^(-1)*add(phi(d)*4^(n/d),d=select(type,divisors(n),even))+5*2^(n-2)
else 2^n
fi
end proc:
map(f, [$1..40]); # Robert Israel, Aug 23 2018
-
a[n_] := If[EvenQ[n], (2n)^(-1) Sum[EulerPhi[d] 4^(n/d), {d, Select[ Divisors[n], EvenQ]}] + 5*2^(n-2), 2^n];
Table[a[n], {n, 3, 40}] (* Jean-François Alcover, Mar 23 2019, after Robert Israel *)
-
a(n) = if (n%2, 2^n, (2*n)^(-1)*sumdiv(n, d, if (!(d%2), eulerphi(d)*4^(n/d))) + 5*2^(n-2)); \\ Michel Marcus, Mar 23 2019
A007148
Number of self-complementary 2-colored bracelets (turnover necklaces) with 2n beads.
Original entry on oeis.org
1, 2, 3, 6, 10, 20, 37, 74, 143, 284, 559, 1114, 2206, 4394, 8740, 17418, 34696, 69194, 137971, 275280, 549258, 1096286, 2188333, 4369162, 8724154, 17422652, 34797199, 69505908, 138845926, 277383872, 554189329, 1107297290, 2212558942
Offset: 1
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
- E. M. Palmer and R. W. Robinson, Enumeration of self-dual configurations Pacific J. Math., 110 (1984), 203-221.
- F. Ruskey, Necklaces, Lyndon words, De Bruijn sequences, etc.
- F. Ruskey, Necklaces, Lyndon words, De Bruijn sequences, etc. [Cached copy, with permission, pdf format only]
- Index entries for sequences related to bracelets
-
# see A245558
L := proc(n,k)
local a,j ;
a := 0 ;
for j in numtheory[divisors](igcd(n,k)) do
a := a+numtheory[mobius](j)*binomial(n/j,k/j) ;
end do:
a/n ;
end proc:
A007148 := proc(n)
local a,k,l;
a := 0 ;
for k from 1 to n do
for l in numtheory[divisors](igcd(n,k)) do
a := a+L(n/l,k/l)*ceil(k/2/l) ;
end do:
end do:
a;
end proc:
seq(A007148(n),n=1..20) ; # R. J. Mathar, Jul 23 2017
-
a[n_] := (1/2)*(2^(n-1) + Total[ EulerPhi[2*#]*2^(n/#) & /@ Divisors[n]]/(2*n)); Table[ a[n], {n, 1, 33}] (* Jean-François Alcover, Oct 25 2011 *)
-
a(n)= (1/2) *(2^(n-1)+sumdiv(n,k,eulerphi(2*k)*2^(n/k))/(2*n))
-
from sympy import divisors, totient
def a(n):
if n==1: return 1
return 2**(n - 2) + sum(totient(2*d)*2**(n//d) for d in divisors(n))//(4*n)
print([a(n) for n in range(1, 31)]) # Indranil Ghosh, Jul 24 2017
A032168
Number of aperiodic necklaces of n beads of 2 colors, 10 of them black.
Original entry on oeis.org
1, 5, 22, 70, 200, 497, 1144, 2424, 4862, 9225, 16796, 29372, 49742, 81686, 130750, 204248, 312455, 468611, 690690, 1001400, 1430715, 2015871, 2804880, 3856528, 5245125, 7060508, 9414328, 12440056, 16301164
Offset: 11
From _Petros Hadjicostas_, Aug 24 2018: (Start)
According to Bower's theory in the web link above, we have exactly k = 10 boxes of different sizes and colors that are placed on a circle. Two boxes are considered identical if they have the same number of balls (i.e., the same size) and the same color. Here c(n) = 1 for all n >= 1, which means all k boxes have at least one ball and only one color. Two configurations of k boxes on the circle with n balls in total are considered equivalent iff one can be obtained from the other by rotation. Since we are dealing with the CHK[k] transform, the configuration of k boxes on the circle must be aperiodic. (This is the meaning of H when we are dealing with order C, i.e., with necklaces. The letter K means that the balls are unlabeled.)
Here, a(n) equals the number of non-equivalent aperiodic configurations of k boxes on the circle (necklaces with k boxes) such that (i) the total number of balls is n, (ii) each box has at least one ball, and (iii) all balls are unlabeled.
Thus, a(n) is the number of unmarked aperiodic cyclic compositions of n with k = 10 positive parts. (The word "umarked" means that two cyclic compositions are equivalent if one can be obtained from the other by rotation.)
Let b_1,b_2,...,b_k be such a cyclic aperiodic composition of n. By definition, b_i >= 1 for i=1,...,k. On a circle, start with a black ball, and place b_1 - 1 white balls to the right of the black ball; then place one black ball followed by b_2 - 1 white balls; continue this until you have a black ball followed by b_k - 1 white balls on the circle. The last white ball (if any) is followed by the first black ball. (If b_k = 1, then the last black ball is followed by the first black ball.) If the position of the first black ball is unmarked, then we may freely rotate the configuration of black and white balls on the circle. We thus get an aperiodic necklace with n balls (or beads) of 2 colors, k = 10 of which are black and n - k = n - 10 of which are white. (We assume of course that n >= 10. Since each necklace is aperiodic, we must have n >= 11 since the configuration b_i = 1 for all i is not allowed.)
The above argument shows that, for n >= k+1 = 11, a(n) is the number of aperiodic necklaces of n beads of 2 colors such that k = 10 of them are black and the rest are white.
For n = 11, a(11) = 1, because we have only one unmarked aperiodic cyclic composition of n = 11 with k = 10 parts and only one aperiodic necklace with 11 beads such that k = 10 of them are black and n-k = 1 of them is white: 2111111111 <-> BWBBBBBBBBB.
For n = 12, a(12) = 5, because we have the following aperiodic cyclic compositions and corresponding aperiodic necklaces:
(1) 3111111111 <-> BWWBBBBBBBBB
(2) 2211111111 <-> BWBWBBBBBBBB
(3) 2121111111 <-> BWBBWBBBBBBB
(4) 2112111111 <-> BWBBBWBBBBBB
(5) 2111211111 <-> BWBBBBWBBBBB
(The configuration 2111121111 <-> BWBBBBBWBBBB is excluded because, on a circle, it has period 2.)
(End)
- Ray Chandler, Table of n, a(n) for n = 11..1011
- C. G. Bower, Transforms (2)
- F. Ruskey, Necklaces, Lyndon words, De Bruijn sequences, etc.
- F. Ruskey, Necklaces, Lyndon words, De Bruijn sequences, etc. [Cached copy, with permission, pdf format only]
- Index entries for sequences related to Lyndon words
- Index entries for linear recurrences with constant coefficients, signature (4,-2,-12,17,9,-32,10,29,-29,-9,28,-7,-5,-5,-7,28,-9,-29,29,10,-32,9,17,-12,-2,4,-1).
-
(* The g.f. given above is the special case k=10 for *)
gf[x_,k_]:=x^k/k Plus@@(MoebiusMu[#](1-x^#)^(-(k/#))&/@Divisors[k])
(* which gives the g.f. for the number of aperiodic necklaces of n beads of 2 colors, k of them black. *) (* Herbert Kociemba, Oct 23 2016 *)
CoefficientList[Series[(1/x)*(1/(1 - x)^10 - 1/(1 - x^2)^5 - 1/(1 - x^5)^2 + 1/(1 - x^10))/10,{x,0,50}],x] (* Stefano Spezia, Aug 31 2018 *)
Comments