A032279
Number of bracelets (turnover necklaces) of n beads of 2 colors, 5 of them black.
Original entry on oeis.org
1, 1, 3, 5, 10, 16, 26, 38, 57, 79, 111, 147, 196, 252, 324, 406, 507, 621, 759, 913, 1096, 1298, 1534, 1794, 2093, 2421, 2793, 3199, 3656, 4152, 4706, 5304, 5967, 6681, 7467, 8311, 9234, 10222, 11298, 12446, 13691, 15015, 16445
Offset: 5
From _Petros Hadjicostas_, Jul 17 2018: (Start)
Every n-bead bracelet of two colors such that 5 beads are black and n-5 are white can be transformed into a dihedral composition of n with 5 positive parts in the following way. Start with one B bead and go in one direction (say clockwise) until you reach the next B bead. Continue this process until you come back to the original B bead.
Let b_i be the number of beads from B bead i until you reach the last W bead before B bead i+1 (or B bead 1). Here, b_i = 1 iff there are no W beads between B bead i and B bead i+1 (or B bead 5 and B bead 1). Then b_1 + b_2 + b_3 + b_4 + b_5 = n, and we get a dihedral composition of n. (Of course, b_2 + b_3 + b_4 + b_5 + b_1 and b_5 + b_4 + b_3 + b_2 + b_1 belong to the same equivalence class of the dihedral composition b_1 + b_2 + b_3 + b_4 + b_5.)
For example, a(8) = 5, and we have the following bracelets with 5 B beads and 3 W beads. Next to the bracelets we list the corresponding dihedral compositions of n with k=5 parts (they must be viewed on a circle):
BBBBBWWW <-> 1+1+1+1+4
BBBBWBWW <-> 1+1+1+2+3
BBWBBBWW <-> 1+2+1+1+3
BWBBWBWB <-> 2+1+2+2+1
BWBWBWBB <-> 2+2+2+1+1
(End)
- N. Zagaglia Salvi, Ordered partitions and colourings of cycles and necklaces, Bull. Inst. Combin. Appl., 27 (1999), 37-40.
- Vincenzo Librandi, Table of n, a(n) for n = 5..1000
- Nesrine Benyahia-Tani, Zahra Yahi, and Sadek Bouroubi Ordered and non-ordered non-congruent convex quadrilaterals inscribed in a regular n-gon. Rostocker Math. Kolloq. 68, 71-79 (2013), Theorem 1.
- N. Benyahia Tani, Z. Yahi, and S. Bouroubi, Ordered and non-ordered non-isometric convex quadrilaterals inscribed in a regular n-gon, Bulletin du Laboratoire Liforce, 01 (2014) 1-9.
- C. G. Bower, Transforms (2)
- S. J. Cyvin, B. N. Cyvin, J. Brunvoll, I. Gutman, Chen Rong-si, S. El-Basil, and Zhang Fuji, Polygonal systems including the corannulene and coronene homologs: novel applications of Pólya's theorem, Z. Naturforsch., 52a (1997), 867-873.
- J. L. Dunn and C. A. Bates, Analysis of the T1u(x)hg system as a model for C60 molecules, Phys. Rev. B 52, 5996, 15 August 1995.
- H. Gupta, Enumeration of incongruent cyclic k-gons, Indian J. Pure and Appl. Math., Vol. 10, No. 8 (1979), 964-999.
- E. Kirkman, J. Kuzmanovich, and J. J. Zhang, Invariants of (-1)-Skew Polynomial Rings under Permutation Representations, arXiv preprint arXiv:1305.3973, 2013. See Example 5.5.
- Richard H. Reis, A formula for C(T) in Gupta's paper, Indian J. Pure and Appl. Math., Vol. 10 , No. 8 (1979), 1000-1001.
- 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]
- Vladimir Shevelev, Necklaces and convex k-gons, Indian J. Pure and Appl. Math., Vol. 35, No. 5 (2004), 629-638.
- Vladimir Shevelev, Necklaces and convex k-gons, Indian J. Pure and Appl. Math., Vol. 35, No. 5 (2004), 629-638.
- Vladimir Shevelev, A problem of enumeration of two-color bracelets with several variations, arXiv:0710.1370 [math.CO], 2007-2011.
- Vladimir Shevelev, Spectrum of permanent's values and its extremal magnitudes in Lambda_n^3 and Lambda_n(alpha,beta,gamma), arXiv:1104.4051 [math.CO], 2011. (Cf. Section 5).
- Index entries for sequences related to bracelets
- Index entries for linear recurrences with constant coefficients, signature (2,1,-4,1,3,-3,-1,4,-1,-2,1).
-
m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(1-x+2*x^3-x^5+x^6)/((1-x)^2*(1-x^2)^2*(1-x^5))); // Vincenzo Librandi, Sep 07 2013
-
seq(floor(n^4/240 + n^3/24 + 5*n^2/24 + 25*n/48 + 1 + (-1)^n*n/16), n=0..100); # Robert Israel, Jul 22 2015
-
k = 5; Table[(Apply[Plus, Map[EulerPhi[ # ]Binomial[n/#, k/# ] &, Divisors[GCD[n, k]]]]/n + Binomial[If[OddQ[n], n - 1, n - If[OddQ[k], 2, 0]]/2, If[OddQ[k], k - 1, k]/2])/2, {n, k, 50}] (* Robert A. Russell, Sep 27 2004 *)
CoefficientList[Series[(1 - x + 2 x^3 - x^5 + x^6) / ((1 - x)^2 (1 - x^2)^2 (1 - x^5)), {x, 0, 50}], x] (* Vincenzo Librandi, Sep 07 2013 *)
k=5 (* Number of black beads in bracelet problem *); CoefficientList[Series[x^k*(1/k Plus@@(EulerPhi[#] (1-x^#)^(-(k/#))&/@Divisors[k])+(1+x)/(1-x^2)^Floor[(k+2)/2])/2,{x,0,50}],x] (* Herbert Kociemba, Nov 04 2016 *)
-
a(n) = round((n^4 -10*n^3 +50*n^2 -(110+30*(1-n%2))*n)/240 +3/5) \\ Washington Bomfim, Jul 17 2008
A053656
Number of cyclic graphs with oriented edges on n nodes (up to symmetry of dihedral group).
Original entry on oeis.org
1, 2, 2, 4, 4, 9, 10, 22, 30, 62, 94, 192, 316, 623, 1096, 2122, 3856, 7429, 13798, 26500, 49940, 95885, 182362, 350650, 671092, 1292762, 2485534, 4797886, 9256396, 17904476, 34636834, 67126282, 130150588, 252679832, 490853416
Offset: 1
Jeb F. Willenbring (jwillenb(AT)ucsd.edu), Feb 14 2000
2 at n=3 because there are two such cycles. On (o -> o -> o ->) and (o -> o <- o ->).
- Jeb F. Willenbring, A stability result for a Hilbert series of O_n(C) invariants.
- Seiichi Manyama, Table of n, a(n) for n = 1..3334
- Rémi Cocou Avohou, Joseph Ben Geloun, and Reiko Toriumi, Counting U(N)^{⊗r} ⊗ O(N)^{⊗q} invariants and tensor model observables, Eur. Phys. J. C 84, 839 (2024), see pp. 11, 27; Preprint arXiv:2404.16404 [hep-th], 2024. See pp. 18, 49.
- Paolo Boldi and Sebastiano Vigna, Fibrations of Graphs, Discrete Math., 243 (2002), 21-66.
- 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. 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.
- Jeb F. Willenbring, Home page.
- A. Yajima, How to calculate the number of stereoisomers of inositol-homologs, Bull. Chem. Soc. Jpn. 2014, 87, 1260-1264. See Tables 1 and 2 (and text).
- Index entries for sequences related to bracelets.
-
v:=proc(n) local k, t1; t1:=0; for k in divisors(n) do t1 := t1+phi(k)*2^(n/k); od: t1; end;
h:=n-> if n mod 2 = 0 then (n/2)*2^(n/2); else 0; fi;
A053656:=n->(v(n)+h(n))/(2*n); # N. J. A. Sloane, Nov 11 2006
-
a[n_] := Total[ EulerPhi[#]*2^(n/#)& /@ Divisors[n]]/(2n) + 2^(n/2-2)(1-Mod[n, 2]); Table[a[n], {n, 1, 35}] (* Jean-François Alcover, Nov 21 2011 *)
-
a(n)={(sumdiv(n, d, eulerphi(d)*2^(n/d))/n + if(n%2==0, 2^(n/2-1)))/2} \\ Andrew Howroyd, Jun 16 2021
A000046
Number of primitive n-bead necklaces (turning over is allowed) where complements are equivalent.
Original entry on oeis.org
1, 1, 1, 1, 2, 3, 5, 8, 14, 21, 39, 62, 112, 189, 352, 607, 1144, 2055, 3885, 7154, 13602, 25472, 48670, 92204, 176770, 337590, 649341, 1246840, 2404872, 4636389, 8964143, 17334800, 33587072, 65107998, 126387975, 245492232, 477349348, 928772649, 1808669170, 3524337789, 6872471442
Offset: 0
For a(7)=8, there are seven achiral set partitions (0000001, 0000011, 0000101, 0000111, 0001001, 0010011, 0010101) and one chiral pair (0001011-0001101). - _Robert A. Russell_, Jun 19 2019
- B. Grünbaum and G. C. Shephard, The geometry of fabrics, pp. 77-98 of F. C. Holroyd and R. J. Wilson, editors, Geometrical Combinatorics. Pitman, Boston, 1984.
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- Christian G. Bower, Table of n, a(n) for n = 0..1000
- E. N. Gilbert and J. Riordan, Symmetry types of periodic sequences, Illinois J. Math., 5 (1961), 657-665.
- J. E. Iglesias, A formula for the number of closest packings of equal spheres having a given repeat period, Z. Krist. 155 (1981) 121-127, Table 1.
- Sara Jensen, Sequence knitting, J. Math. Arts (2023).
- Karyn McLellan, Periodic coefficients and random Fibonacci sequences, Electronic Journal of Combinatorics, 20(4), 2013, #P32.
- Index entries for sequences related to necklaces
Similar to
A000011, but counts primitive necklaces.
-
with(numtheory); A000046 := proc(n) local s,d; if n = 0 then RETURN(1); else s := 0; for d in divisors(n) do s := s+mobius(d)*A000011(n/d); od; RETURN(s); fi; end;
-
a11[0] = 1; a11[n_] := 2^Floor[n/2]/2 + Sum[EulerPhi[2*d]*2^(n/d), {d, Divisors[n]}]/n/4; a[0] = 1; a[n_] := Sum[MoebiusMu[d]*a11[n/d], {d, Divisors[n]}]; Table[a[n], {n, 0, 36}] (* Jean-François Alcover, Jul 10 2012, from formula *)
Join[{1}, Table[(DivisorSum[NestWhile[#/2 &, n, EvenQ], MoebiusMu[#] 2^(n/#) &]/(2 n) + DivisorSum[n, MoebiusMu[n/#] 2^Floor[#/2] &])/2, {n, 1, 40}]] (* Robert A. Russell, Jun 19 2019 *)
-
apply( {A000046(n)=if(n, sumdiv(n, d, moebius(d)*A000011(n/d)), 1)}, [0..40]) \\ M. F. Hasler, May 27 2025
A005648
Number of 2n-bead black-white reversible necklaces with n black beads.
Original entry on oeis.org
1, 1, 2, 3, 8, 16, 50, 133, 440, 1387, 4752, 16159, 56822, 200474, 718146, 2587018, 9398520, 34324174, 126068558, 465093571, 1723176308, 6407924300, 23910576230, 89494164973, 335913918902, 1264107416466
Offset: 0
a(2) = 2: BBWW, BWBW.
a(3) = 3: BBBWWW, BBWBWW, BWBWBW.
a(4) = 8: BBBBWWWW, BBBWBWWW, BBBWWBWW, BBWWBBWW, BBWBWBWW, BBWBWWBW, BBWBBWWW, BWBWBWBW.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- G. C. Greubel, Table of n, a(n) for n = 0..1665 (terms 0..200 from Andrew Howroyd)
- Marcia Ascher, Mu torere: an analysis of a Maori game, Math. Mag. 60 (1987), no. 2, 90-100.
- R. K. Guy & N. J. A. Sloane, Correspondence, 1985
- Paul Melotti, Sanjay Ramassamy, Paul Thévenin, Points and lines configurations for perpendicular bisectors of convex cyclic polygons, arXiv:2003.11006 [math.CO], 2020.
- 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
-
f[k_Integer, n_] := (Plus @@ (EulerPhi[ # ]Binomial[n/#, k/# ] & /@ Divisors[GCD[n, k]])/n + Binomial[(n - If[OddQ@n, 1, If[OddQ@k, 2, 0]])/2, (k - If[OddQ@k, 1, 0])/2])/2 (* Robert A. Russell, Sep 27 2004 *)
Table[ f[n, 2n], {n, 27}] (* Robert G. Wilson v, Mar 29 2006 *)
a[0] = 1; a[n_] := 1/2*(Binomial[2*Quotient[n, 2], Quotient[n, 2]] + DivisorSum[n, EulerPhi[#]*Binomial[2*n/#, n/#]&]/(2*n)); Array[a, 26, 0] (* Jean-François Alcover, Nov 05 2017, translated from PARI *)
-
a(n) = 1/2*( binomial(2*(n\2), n\2) + if(n<1, n >= 0, sumdiv(n, k, eulerphi(k)*binomial(2*n/k, n/k))/(2*n) ));
A261494
Number A(n,k) of necklaces with n white beads and k*n black beads; square array A(n,k), n>=0, k>=0, read by antidiagonals.
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 4, 1, 1, 1, 4, 10, 10, 1, 1, 1, 5, 19, 43, 26, 1, 1, 1, 6, 31, 116, 201, 80, 1, 1, 1, 7, 46, 245, 776, 1038, 246, 1, 1, 1, 8, 64, 446, 2126, 5620, 5538, 810, 1, 1, 1, 9, 85, 735, 4751, 19811, 42288, 30667, 2704, 1
Offset: 0
A(2,2) = 3: 000011, 000101, 001001.
A(3,2) = 10: 000000111, 000001011, 000010011, 000100011, 001000011, 010000011, 000010101, 000100101, 001000101, 001001001.
Square array A(n,k) begins:
1, 1, 1, 1, 1, 1, 1, ...
1, 1, 1, 1, 1, 1, 1, ...
1, 2, 3, 4, 5, 6, 7, ...
1, 4, 10, 19, 31, 46, 64, ...
1, 10, 43, 116, 245, 446, 735, ...
1, 26, 201, 776, 2126, 4751, 9276, ...
1, 80, 1038, 5620, 19811, 54132, 124936, ...
- Alois P. Heinz, Antidiagonals n = 0..140, flattened
- 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, Necklace
- Wikipedia, Necklace (combinatorics)
- Index entries for sequences related to necklaces
Columns k=0-10 give:
A000012,
A003239,
A082936,
A261497,
A261498,
A261499,
A261500,
A261501,
A261502,
A261503,
A261504.
-
with(numtheory):
A:= (n, k)-> `if`(n=0, 1, add(binomial((k+1)*n/d, n/d)
*phi(d), d=divisors(n))/((k+1)*n)):
seq(seq(A(n, d-n), n=0..d), d=0..14);
-
A[n_, k_] := If[n==0, 1, DivisorSum[n, Binomial[(k+1)*n/#, n/#]*EulerPhi[#] /((k+1)*n)&]]; Table[A[n, d-n], {d, 0, 14}, {n, 0, d}] // Flatten (* Jean-François Alcover, Feb 19 2017, translated from Maple *)
-
a(n,k) = if(n<1, 1, sumdiv(n, d, binomial((k + 1)*n/d, n/d) * eulerphi(d)) / ((k + 1)*n));
for(d=0, 14, for(n=0, d, print1(a(n, d - n),", ");); print();) \\ Indranil Ghosh, Mar 25 2017
A032275
Number of bracelets (turnover necklaces) of n beads of 4 colors.
Original entry on oeis.org
4, 10, 20, 55, 136, 430, 1300, 4435, 15084, 53764, 192700, 704370, 2589304, 9608050, 35824240, 134301715, 505421344, 1909209550, 7234153420, 27489127708, 104717491064, 399827748310, 1529763696820
Offset: 1
For n=2, the ten bracelets are AA, AB, AC, AD, BB, BC, BD, CC, CD, and DD. - _Robert A. Russell_, Sep 24 2018
- 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]
- M. Taniguchi, H. Du, and J. S. Lindsey, Enumeration of virtual libraries of combinatorial modular macrocyclic (bracelet, necklace) architectures and their linear counterparts, Journal of Chemical Information and Modeling, 53 (2013), 2203-2216.
- Index entries for sequences related to bracelets
-
mx=40;CoefficientList[Series[(1-Sum[ EulerPhi[n]*Log[1-4*x^n]/n,{n,mx}]+(1+4 x+6 x^2)/(1-4 x^2))/2,{x,0,mx}],x] (* Herbert Kociemba, Nov 02 2016 *)
k=4; Table[DivisorSum[n, EulerPhi[#] k^(n/#) &]/(2n) + (k^Floor[(n+1)/2] + k^Ceiling[(n+1)/2])/4, {n, 1, 30}] (* Robert A. Russell, Sep 24 2018 *)
A056353
Number of bracelet structures using a maximum of three different colored beads.
Original entry on oeis.org
1, 1, 2, 3, 6, 9, 22, 40, 100, 225, 582, 1464, 3960, 10585, 29252, 80819, 226530, 636321, 1800562, 5107480, 14548946, 41538916, 118929384, 341187048, 980842804, 2824561089, 8147557742, 23536592235, 68087343148, 197216119545, 571924754778, 1660419530056, 4825588205920
Offset: 0
- M. R. Nester (1999). Mathematical investigations of some plant interaction designs. PhD Thesis. University of Queensland, Brisbane, Australia. [See A056391 for pdf file of Chap. 2]
a(0)=1 prepended and terms a(28) and beyond from
Andrew Howroyd, Oct 25 2019
A059053
Number of chiral pairs of necklaces with n beads and two colors (color complements being equivalent); i.e., turning the necklace over neither leaves it unchanged nor simply swaps the colors.
Original entry on oeis.org
0, 0, 0, 0, 0, 0, 0, 1, 2, 7, 12, 31, 58, 126, 234, 484, 906, 1800, 3402, 6643, 12624, 24458, 46686, 90157, 172810, 333498, 641340, 1238671, 2388852, 4620006, 8932032, 17302033, 33522698, 65042526, 126258960, 245361172, 477091232
Offset: 0
For a(7) = 1, the chiral pair is AAABABB-AAABBAB.
For a(8) = 2, the chiral pairs are AAAABABB-AAAABBAB and AAABAABB-AAABBAAB.
-
Prepend[Table[DivisorSum[n, EulerPhi[#] StirlingS2[n/# + If[Divisible[#,2],1,0], 2] &] / (2n) - StirlingS2[1+Floor[n/2],2] / 2, {n, 1, 40}],0] (* Robert A. Russell, Oct 02 2018 *)
-
a(n) = {if(n<1, 0, (sumdiv(n, k, eulerphi(2*k) * 2^(n/k)) / (2*n) - 2^(n\2))/2)}; \\ Andrew Howroyd, Nov 03 2019
A032192
Number of necklaces with 7 black beads and n-7 white beads.
Original entry on oeis.org
1, 1, 4, 12, 30, 66, 132, 246, 429, 715, 1144, 1768, 2652, 3876, 5538, 7752, 10659, 14421, 19228, 25300, 32890, 42288, 53820, 67860, 84825, 105183, 129456, 158224, 192130, 231880, 278256, 332112, 394383, 466089, 548340
Offset: 7
- C. G. Bower, Transforms (2)
- David Broadhurst and Xavier Roulleau, Number of partitions of modular integers, arXiv:2502.19523 [math.NT], 2025. See p. 19.
- Mónica A. Reyes, Cristina Dalfó, Miguel Àngel Fiol, and Arnau Messegué, A general method to find the spectrum and eigenspaces of the k-token of a cycle, and 2-token through continuous fractions, arXiv:2403.20148 [math.CO], 2024. See pp. 5-6.
- Frank Ruskey, Necklaces, Lyndon words, De Bruijn sequences, etc.
- Frank Ruskey, Necklaces, Lyndon words, De Bruijn sequences, etc. [Cached copy, with permission, pdf format only]
- Index entries for sequences related to necklaces
- Index entries for linear recurrences with constant coefficients, signature (6,-15,20,-15,6,-1,1,-6,15,-20,15,-6,1).
-
k = 7; Table[Apply[Plus, Map[EulerPhi[ # ]Binomial[n/#, k/# ] &, Divisors[GCD[n, k]]]]/n, {n, k, 30}] (* Robert A. Russell, Sep 27 2004 *)
DeleteCases[CoefficientList[Series[x^7 (x^6 - 5 x^5 + 13 x^4 - 17 x^3 + 13 x^2 - 5 x + 1)/((x^6 + x^5 + x^4 + x^3 + x^2 + x + 1) (1 - x)^7), {x, 0, 41}], x], 0] (* Michael De Vlieger, Oct 10 2016 *)
A032239
Number of identity bracelets of n beads of 2 colors.
Original entry on oeis.org
2, 1, 0, 0, 0, 1, 2, 6, 14, 30, 62, 127, 252, 493, 968, 1860, 3600, 6902, 13286, 25446, 48914, 93775, 180314, 346420, 666996, 1284318, 2477328, 4781007, 9240012, 17870709, 34604066, 67058880, 130084990, 252545160, 490722342
Offset: 1
- Andrew Howroyd, Table of n, a(n) for n = 1..1000
- C. G. Bower, Transforms (2)
- Petros Hadjicostas, Formulas for chiral bracelets, 2019; see Section 5.
- 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
-
m = 2; (* asymmetric bracelets of n beads of m colors *) Table[Sum[MoebiusMu[d] (m^(n/d)/n - If[OddQ[n/d], m^((n/d + 1)/2), ((m + 1) m^(n/(2 d))/2)]), {d, Divisors[n]}]/2, {n, 3, 20}] (* Robert A. Russell, Mar 18 2013 *)
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[Rest[CoefficientList[Series[gf[x,2],{x,0,mx}],x]],{1->2,2->1}] (* Herbert Kociemba, Nov 29 2016 *)
-
a(n)={if(n<3, binomial(2,n), sumdiv(n, d, moebius(n/d)*(2^d/n - if(d%2, 2^((d+1)/2), 3*2^(d/2)/2)))/2)} \\ Andrew Howroyd, Sep 12 2019
Comments