cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 32 results. Next

A000031 Number of n-bead necklaces with 2 colors when turning over is not allowed; also number of output sequences from a simple n-stage cycling shift register; also number of binary irreducible polynomials whose degree divides n.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 14, 20, 36, 60, 108, 188, 352, 632, 1182, 2192, 4116, 7712, 14602, 27596, 52488, 99880, 190746, 364724, 699252, 1342184, 2581428, 4971068, 9587580, 18512792, 35792568, 69273668, 134219796, 260301176, 505294128, 981706832
Offset: 0

Views

Author

Keywords

Comments

Also a(n)-1 is the number of 1's in the truth table for the lexicographically least de Bruijn cycle (Fredricksen).
In music, a(n) is the number of distinct classes of scales and chords in an n-note equal-tempered tuning system. - Paul Cantrell, Dec 28 2011
Also, minimum cardinality of an unavoidable set of length-n binary words (Champarnaud, Hansel, Perrin). - Jeffrey Shallit, Jan 10 2019
(1/n) * Dirichlet convolution of phi(n) and 2^n, n>0. - Richard L. Ollerton, May 06 2021
From Jianing Song, Nov 13 2021: (Start)
a(n) is even for n != 0, 2. Proof: write n = 2^e * s with odd s, then a(n) * s = Sum_{d|s} Sum_{k=0..e} phi((2^e*s)/(2^k*d)) * 2^(2^k*d-e) = Sum_{d|s} Sum_{k=0..e-1} phi(s/d) * 2^(2^k*d-k-1) + Sum_{d|s} phi(s/d) * 2^(2^e*d-e) == Sum_{k=0..e-1} 2^(2^k*s-k-1) + 2^(2^e*s-e) == Sum_{k=0..min{e-1,1}} 2^(2^k*s-k-1) (mod 2). a(n) is odd if and only if s = 1 and e-1 = 0, or n = 2.
a(n) == 2 (mod 4) if and only if n = 1, 4 or n = 2*p^e with prime p == 3 (mod 4).
a(n) == 4 (mod 8) if and only if n = 2^e, 3*2^e for e >= 3, or n = p^e, 4*p^e != 12 with prime p == 3 (mod 4), or n = 2s where s is an odd number such that phi(s) == 4 (mod 8). (End)

Examples

			For n=3 and n=4 the necklaces are {000,001,011,111} and {0000,0001,0011,0101,0111,1111}.
The analogous shift register sequences are {000..., 001001..., 011011..., 111...} and {000..., 00010001..., 00110011..., 0101..., 01110111..., 111...}.
		

References

  • S. W. Golomb, Shift-Register Sequences, Holden-Day, San Francisco, 1967, pp. 120, 172.
  • May, Robert M. "Simple mathematical models with very complicated dynamics." Nature, Vol. 261, June 10, 1976, pp. 459-467; reprinted in The Theory of Chaotic Attractors, pp. 85-93. Springer, New York, NY, 2004. The sequences listed in Table 2 are A000079, A027375, A000031, A001037, A000048, A051841. - N. J. A. Sloane, Mar 17 2019
  • 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).
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 7.112(a).

Crossrefs

Column 2 of A075195.
Cf. A001037 (primitive solutions to same problem), A014580, A000016, A000013, A000029 (if turning over is allowed), A000011, A001371, A058766.
Rows sums of triangle in A047996.
Dividing by 2 gives A053634.
A008965(n) = a(n) - 1 allowing different offsets.
Cf. A008965, A053635, A052823, A100447 (bisection).
Cf. A000010.

Programs

  • Haskell
    a000031 0 = 1
    a000031 n = (`div` n) $ sum $
       zipWith (*) (map a000010 divs) (map a000079 $ reverse divs)
       where divs = a027750_row n
    -- Reinhard Zumkeller, Mar 21 2013
    
  • Maple
    with(numtheory); A000031 := proc(n) local d,s; if n = 0 then RETURN(1); else s := 0; for d in divisors(n) do s := s+phi(d)*2^(n/d); od; RETURN(s/n); fi; end; [ seq(A000031(n), n=0..50) ];
  • Mathematica
    a[n_] := Sum[If[Mod[n, d] == 0, EulerPhi[d] 2^(n/d), 0], {d, 1, n}]/n
    a[n_] := Fold[#1 + 2^(n/#2) EulerPhi[#2] &, 0, Divisors[n]]/n (* Ben Branman, Jan 08 2011 *)
    Table[Expand[CycleIndex[CyclicGroup[n], t] /. Table[t[i]-> 2, {i, 1, n}]], {n,0, 30}] (* Geoffrey Critzer, Mar 06 2011*)
    a[0] = 1; a[n_] := DivisorSum[n, EulerPhi[#]*2^(n/#)&]/n; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Feb 03 2016 *)
    mx=40; CoefficientList[Series[1-Sum[EulerPhi[i] Log[1-2*x^i]/i,{i,1,mx}],{x,0,mx}],x] (*Herbert Kociemba, Oct 29 2016 *)
  • PARI
    {A000031(n)=if(n==0,1,sumdiv(n,d,eulerphi(d)*2^(n/d))/n)} \\ Randall L Rathbun, Jan 11 2002
    
  • Python
    from sympy import totient, divisors
    def A000031(n): return sum(totient(d)*(1<Chai Wah Wu, Nov 16 2022

Formula

a(n) = (1/n)*Sum_{ d divides n } phi(d)*2^(n/d) = A053635(n)/n, where phi is A000010.
Warning: easily confused with A001037, which has a similar formula.
G.f.: 1 - Sum_{n>=1} phi(n)*log(1 - 2*x^n)/n. - Herbert Kociemba, Oct 29 2016
a(0) = 1; a(n) = (1/n) * Sum_{k=1..n} 2^gcd(n,k). - Ilya Gutkovskiy, Apr 16 2021
a(0) = 1; a(n) = (1/n)*Sum_{k=1..n} 2^(n/gcd(n,k))*phi(gcd(n,k))/phi(n/gcd(n,k)). - Richard L. Ollerton, May 06 2021
Dirichlet g.f.: f(s+1) * (zeta(s)/zeta(s+1)), where f(s) = Sum_{n>=1} 2^n/n^s. - Jianing Song, Nov 13 2021

Extensions

There is an error in Fig. M3860 in the 1995 Encyclopedia of Integer Sequences: in the third line, the formula for A000031 = M0564 should be (1/n) sum phi(d) 2^(n/d).

A056665 Number of equivalence classes of n-valued Post functions of 1 variable under action of complementing group C(1,n).

Original entry on oeis.org

1, 3, 11, 70, 629, 7826, 117655, 2097684, 43046889, 1000010044, 25937424611, 743008623292, 23298085122493, 793714780783770, 29192926025492783, 1152921504875290696, 48661191875666868497, 2185911559749720272442, 104127350297911241532859
Offset: 1

Views

Author

Vladeta Jovovic, Aug 09 2000

Keywords

Comments

Diagonal of arrays defined in A054630 and A054631.
Given n colors, a(n) = number of necklaces with n beads and 1 up to n colors effectively assigned to them (super_labeled: which also generates n different monochrome necklaces). - Wouter Meeussen, Aug 09 2002
Number of endofunctions on a set with n objects up to cyclic permutation (rotation). E.g., for n = 3, the 11 endofunctions are 1,1,1; 2,2,2; 3,3,3; 1,1,2; 1,2,2; 1,1,3; 1,3,3; 2,2,3; 2,3,3; 1,2,3; and 1,3,2. - Franklin T. Adams-Watters, Jan 17 2007
Also number of pre-necklaces in Sigma(n,n) (see Ruskey and others). - Peter Luschny, Aug 12 2012
From Olivier Gérard, Aug 01 2016: (Start)
Decomposition of the endofunctions by class size.
.
n | 1 2 3 4 5 6 7
--+----------------------------------
1 | 1
2 | 2 1
3 | 3 0 8
4 | 4 6 0 60
5 | 5 0 0 0 624
6 | 6 15 70 0 0 7735
7 | 7 0 0 0 0 0 117648
.
The right diagonal gives the number of Lyndon Words or aperiodic necklaces, A075147. By multiplying each column by the corresponding size and summing, one gets A000312.
(End)

Examples

			The 11 necklaces for n=3 are (grouped by partition of 3): (RRR,GGG,BBB),(RRG,RGG, RRB,RBB, GGB,GBB), (RGB,RBG).
		

References

  • D. E. Knuth. Generating All Tuples and Permutations. The Art of Computer Programming, Vol. 4, Fascicle 2, 7.2.1.1. Addison-Wesley, 2005.

Crossrefs

Diagonal of arrays defined in A054630, A054631 and A075195.
Cf. A075147 Aperiodic necklaces, a subset of this sequence.
Cf. A000169 Classes under translation mod n
Cf. A168658 Classes under complement to n+1
Cf. A130293 Classes under translation and rotation
Cf. A081721 Classes under rotation and reversal
Cf. A275549 Classes under reversal
Cf. A275550 Classes under reversal and complement
Cf. A275551 Classes under translation and reversal
Cf. A275552 Classes under translation and complement
Cf. A275553 Classes under translation, complement and reversal
Cf. A275554 Classes under translation, rotation and complement
Cf. A275555 Classes under translation, rotation and reversal
Cf. A275556 Classes under translation, rotation, complement and reversal
Cf. A275557 Classes under rotation and complement
Cf. A275558 Classes under rotation, complement and reversal
Cf. A228640.

Programs

  • Maple
    with(numtheory):
    a:= n-> add(phi(d)*n^(n/d), d=divisors(n))/n:
    seq(a(n), n=1..25);  # Alois P. Heinz, Jun 18 2013
  • Mathematica
    Table[Fold[ #1+EulerPhi[ #2] n^(n/#2)&, 0, Divisors[n]]/n, {n, 7}]
  • PARI
    a(n) = sum(k=1,n,n^gcd(k,n)) / n; \\ Joerg Arndt, Mar 19 2017
  • Sage
    # This algorithm counts all n-ary n-tuples (a_1,..,a_n) such that the string a_1...a_n is preprime. It is algorithm F in Knuth 7.2.1.1.
    def A056665_list(n):
        C = []
        for m in (1..n):
            a = [0]*(n+1); a[0]=-1;
            j = 1; count = 0
            while(true):
                if m%j == 0 : count += 1;
                j = n
                while a[j] >= m-1 : j -= 1
                if j == 0 : break
                a[j] += 1
                for k in (j+1..n): a[k] = a[k-j]
            C.append(count)
        return C
    
  • Sage
    def A056665(n): return sum(euler_phi(d)*n^(n//d)//n for d in divisors(n))
    [A056665(n) for n in (1..18)] # Peter Luschny, Aug 12 2012
    

Formula

a(n) = Sum_{d|n} phi(d)*n^(n/d)/n.
a(n) ~ n^(n-1). - Vaclav Kotesovec, Sep 11 2014
a(n) = (1/n) * Sum_{k=1..n} n^gcd(k,n). - Joerg Arndt, Mar 19 2017
a(n) = [x^n] -Sum_{k>=1} phi(k)*log(1 - n*x^k)/k. - Ilya Gutkovskiy, Mar 21 2018
From Richard L. Ollerton, May 07 2021: (Start)
a(n) = (1/n)*Sum_{k=1..n} n^(n/gcd(n,k))*phi(gcd(n,k))/phi(n/gcd(n,k)).
a(n) = (1/n)*A228640(n). (End)

A185651 A(n,k) = Sum_{d|n} phi(d)*k^(n/d); square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 6, 3, 0, 0, 4, 12, 12, 4, 0, 0, 5, 20, 33, 24, 5, 0, 0, 6, 30, 72, 96, 40, 6, 0, 0, 7, 42, 135, 280, 255, 84, 7, 0, 0, 8, 56, 228, 660, 1040, 780, 140, 8, 0, 0, 9, 72, 357, 1344, 3145, 4200, 2205, 288, 9, 0
Offset: 0

Views

Author

Alois P. Heinz, Aug 29 2013

Keywords

Comments

Dirichlet convolution of phi(n) and k^n. - Richard L. Ollerton, May 07 2021

Examples

			Square array A(n,k) begins:
  0, 0,  0,   0,    0,     0,     0, ...
  0, 1,  2,   3,    4,     5,     6, ...
  0, 2,  6,  12,   20,    30,    42, ...
  0, 3, 12,  33,   72,   135,   228, ...
  0, 4, 24,  96,  280,   660,  1344, ...
  0, 5, 40, 255, 1040,  3145,  7800, ...
  0, 6, 84, 780, 4200, 15810, 46956, ...
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    A:= (n, k)-> add(phi(d)*k^(n/d), d=divisors(n)):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • Mathematica
    a[, 0] = a[0, ] = 0; a[n_, k_] := Sum[EulerPhi[d]*k^(n/d), {d, Divisors[n]}]; Table[a[n - k, k], {n, 0, 12}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Dec 06 2013 *)

Formula

A(n,k) = Sum_{d|n} phi(d)*k^(n/d).
A(n,k) = Sum_{i=0..min(n,k)} C(k,i) * i! * A258170(n,i). - Alois P. Heinz, May 22 2015
G.f. for column k: Sum_{n>=1} phi(n)*k*x^n/(1-k*x^n) for k >= 0. - Petros Hadjicostas, Nov 06 2017
From Richard L. Ollerton, May 07 2021: (Start)
A(n,k) = Sum_{i=1..n} k^gcd(n,i).
A(n,k) = Sum_{i=1..n} k^(n/gcd(n,i))*phi(gcd(n,i))/phi(n/gcd(n,i)).
A(n,k) = A075195(n,k)*n for n >= 1, k >= 1. (End)

A001867 Number of n-bead necklaces with 3 colors.

Original entry on oeis.org

1, 3, 6, 11, 24, 51, 130, 315, 834, 2195, 5934, 16107, 44368, 122643, 341802, 956635, 2690844, 7596483, 21524542, 61171659, 174342216, 498112275, 1426419858, 4093181691, 11767920118, 33891544419, 97764131646, 282429537947, 817028472960, 2366564736723
Offset: 0

Views

Author

Keywords

Comments

From Richard L. Ollerton, May 07 2021: (Start)
Here, as in A000031, turning over is not allowed.
(1/n) * Dirichlet convolution of phi(n) and 3^n, n>0. (End)

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 162.
  • 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).
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 7.112(a).

Crossrefs

Column 3 of A075195.
Cf. A054610.

Programs

  • Maple
    with(numtheory): A001867:= n-> `if` (n=0, 1, add (phi(d)* 3^(n/d), d=divisors(n))/n): seq (A001867(n), n=0..40);
    spec := [N, {N=Cycle(bead), bead=Union(R,G,B), R=Atom, B=Atom, G=Atom}]; [seq(combstruct[count](spec, size=n), n=1..40)];
  • Mathematica
    Prepend[Table[CyclicGroupIndex[n,t]/.Table[t[i]->3,{i,1,n}],{n,1,28}],1]  (* Geoffrey Critzer, Sep 16 2011 *)
    mx=40;CoefficientList[Series[1-Sum[EulerPhi[i] Log[1-3*x^i]/i,{i,1,mx}],{x,0,mx}],x] (* Herbert Kociemba, Nov 01 2016 *)
    k=3; Prepend[Table[DivisorSum[n, EulerPhi[#] k^(n/#) &]/n, {n, 1, 30}], 1] (* Robert A. Russell, Sep 21 2018 *)
  • PARI
    a(n)=if (n==0, 1, 1/n * sumdiv(n, d, eulerphi(d)*3^(n/d) )); /* Joerg Arndt, Jul 04 2011 */

Formula

a(n) = (1/n)*Sum_{d|n} phi(d)*3^(n/d), n>0.
G.f.: 1 - Sum_{n>=1} phi(n)*log(1 - 3*x^n)/n. - Herbert Kociemba, Nov 01 2016
a(n) ~ 3^n/n. - Vaclav Kotesovec, Nov 01 2016
a(0) = 1; a(n) = (1/n) * Sum_{k=1..n} 3^gcd(n,k). - Ilya Gutkovskiy, Apr 16 2021
a(0) = 1; a(n) = (1/n)*Sum_{k=1..n} 3^(n/gcd(n,k))*phi(gcd(n,k))/phi(n/gcd(n,k)). - Richard L. Ollerton, May 07 2021

A152175 Triangle read by rows: T(n,k) is the number of k-block partitions of an n-set up to rotations.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 3, 5, 2, 1, 1, 7, 18, 13, 3, 1, 1, 9, 43, 50, 20, 3, 1, 1, 19, 126, 221, 136, 36, 4, 1, 1, 29, 339, 866, 773, 296, 52, 4, 1, 1, 55, 946, 3437, 4281, 2303, 596, 78, 5, 1, 1, 93, 2591, 13250, 22430, 16317, 5817, 1080, 105, 5, 1, 1, 179, 7254, 51075, 115100, 110462, 52376, 13299, 1873, 147, 6, 1
Offset: 1

Views

Author

Vladeta Jovovic, Nov 27 2008

Keywords

Comments

Number of n-bead necklace structures using exactly k different colored beads. Turning over the necklace is not allowed. Permuting the colors does not change the structure. - Andrew Howroyd, Apr 06 2017

Examples

			Triangle begins with T(1,1):
  1;
  1,   1;
  1,   1,     1;
  1,   3,     2,      1;
  1,   3,     5,      2,      1;
  1,   7,    18,     13,      3,      1;
  1,   9,    43,     50,     20,      3,      1;
  1,  19,   126,    221,    136,     36,      4,      1;
  1,  29,   339,    866,    773,    296,     52,      4,     1;
  1,  55,   946,   3437,   4281,   2303,    596,     78,     5,    1;
  1,  93,  2591,  13250,  22430,  16317,   5817,   1080,   105   , 5,   1;
  1, 179,  7254,  51075, 115100, 110462,  52376,  13299,  1873,  147,   6, 1;
  1, 315, 20125, 194810, 577577, 717024, 439648, 146124, 27654, 3025, 187, 6, 1;
  ...
For T(4,2)=3, the set partitions are AAAB, AABB, and ABAB.
For T(4,3)=2, the set partitions are AABC and ABAC.
		

References

  • 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]

Crossrefs

Columns 2-6 are A056295, A056296, A056297, A056298, A056299.
Row sums are A084423.
Partial row sums include A000013, A002076, A056292, A056293, A056294.
Cf. A075195, A087854, A008277 (set partitions), A284949 (up to reflection), A152176 (up to rotation and reflection).
A(1,n,k) in formula is the Stirling subset number A008277.
A(2,n,k) in formula is A293181; A(3,n,k) in formula is A294201.

Programs

  • Mathematica
    (* Using recursion formula from Gilbert and Riordan:*)
    Adn[d_, n_] := Adn[d, n] = Which[0==n, 1, 1==n, DivisorSum[d, x^# &],
      1==d, Sum[StirlingS2[n, k] x^k, {k, 0, n}],
      True, Expand[Adn[d, 1] Adn[d, n-1] + D[Adn[d, n - 1], x] x]];
    Table[CoefficientList[DivisorSum[n, EulerPhi[#] Adn[#, n/#] &]/(x n), x],
       {n, 1, 10}] // Flatten (* Robert A. Russell, Feb 23 2018 *)
    Adnk[d_,n_,k_] := Adnk[d,n,k] = If[n>0 && k>0, Adnk[d,n-1,k]k + DivisorSum[d,Adnk[d,n-1,k-#] &], Boole[n==0 && k==0]]
    Table[DivisorSum[n,EulerPhi[#]Adnk[#,n/#,k]&]/n,{n,1,12},{k,1,n}] // Flatten (* Robert A. Russell, Oct 16 2018 *)
  • PARI
    \\ see A056391 for Polya enumeration functions
    T(n,k) = NonequivalentStructsExactly(CyclicPerms(n), k); \\ Andrew Howroyd, Oct 14 2017
    
  • PARI
    R(n) = {Mat(Col([Vecrev(p/y, n) | p<-Vec(intformal(sum(m=1, n, eulerphi(m) * subst(serlaplace(-1 + exp(sumdiv(m, d, y^d*(exp(d*x + O(x*x^(n\m)))-1)/d))), x, x^m))/x))]))}
    { my(A=R(12)); for(n=1, #A, print(A[n, 1..n])) } \\ Andrew Howroyd, Sep 20 2019

Formula

T(n,k) = (1/n)*Sum_{d|n} phi(d)*A(d,n/d,k), where A(d,n,k) = [n==0 & k==0] + [n>0 & k>0]*(k*A(d,n-1,k) + Sum_{j|d} A(d,n-1,k-j)). - Robert A. Russell, Oct 16 2018

A001868 Number of n-bead necklaces with 4 colors.

Original entry on oeis.org

1, 4, 10, 24, 70, 208, 700, 2344, 8230, 29144, 104968, 381304, 1398500, 5162224, 19175140, 71582944, 268439590, 1010580544, 3817763740, 14467258264, 54975633976, 209430787824, 799645010860, 3059510616424, 11728124734500, 45035996273872, 173215372864600, 667199944815064
Offset: 0

Views

Author

Keywords

Comments

From Richard L. Ollerton, May 07 2021: (Start)
Here, as in A000031, turning over is not allowed.
(1/n) * Dirichlet convolution of phi(n) and 4^n, n>0. (End)

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 162.
  • 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).
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 7.112(a).

Crossrefs

Column 4 of A075195.
Cf. A054611.

Programs

  • Maple
    A001868 := proc(n) local d,s; if n = 0 then RETURN(1); else s := 0; for d in divisors(n) do s := s+phi(d)*4^(n/d); od; RETURN(s/n); fi; end;
  • Mathematica
    a[n_] := (1/n)*Total[ EulerPhi[#]*4^(n/#) &  /@ Divisors[n]]; a[0] = 1; Table[a[n], {n, 0, 24}] (* Jean-François Alcover, Oct 21 2011 *)
    mx=40;CoefficientList[Series[1-Sum[EulerPhi[i] Log[1-4*x^i]/i,{i,1,mx}],{x,0,mx}],x] (* Herbert Kociemba, Nov 01 2016 *)
    k=4; Prepend[Table[DivisorSum[n, EulerPhi[#] k^(n/#) &]/n, {n, 1, 30}], 1] (* Robert A. Russell, Sep 21 2018 *)
  • PARI
    a(n) = if (n, sumdiv(n, d, eulerphi(d)*4^(n/d))/n, 1); \\ Michel Marcus, Nov 01 2016

Formula

a(n) = (1/n)*Sum_{d|n} phi(d)*4^(n/d) = A054611(n)/n, n>0.
G.f.: 1 - Sum_{n>=1} phi(n)*log(1 - 4*x^n)/n. - Herbert Kociemba, Nov 01 2016
a(0) = 1; a(n) = (1/n) * Sum_{k=1..n} 4^gcd(n,k). - Ilya Gutkovskiy, Apr 17 2021
a(0) = 1; a(n) = (1/n)*Sum_{k=1..n} 4^(n/gcd(n,k))*phi(gcd(n,k))/phi(n/gcd(n,k)). - Richard L. Ollerton, May 07 2021

A027671 Number of necklaces with n beads of 3 colors, allowing turning over.

Original entry on oeis.org

1, 3, 6, 10, 21, 39, 92, 198, 498, 1219, 3210, 8418, 22913, 62415, 173088, 481598, 1351983, 3808083, 10781954, 30615354, 87230157, 249144711, 713387076, 2046856566, 5884491500, 16946569371, 48883660146, 141217160458, 408519019449, 1183289542815
Offset: 0

Views

Author

Keywords

Comments

Number of bracelets of n beads using up to three different colors. - Robert A. Russell, Sep 24 2018

Examples

			For n=2, the six bracelets are AA, AB, AC, BB, BC, and CC. - _Robert A. Russell_, Sep 24 2018
		

References

  • J. L. Fisher, Application-Oriented Algebra (1977), ISBN 0-7002-2504-8, circa p. 215.
  • M. Gardner, "New Mathematical Diversions from Scientific American" (Simon and Schuster, New York, 1966), pp. 245-246.

Crossrefs

a(n) = A081720(n,3), n >= 3. - Wolfdieter Lang, Jun 03 2012
Column 3 of A051137.
a(n) = A278639(n) + A182751(n+1).
Equals A001867 - A278639.

Programs

  • Mathematica
    Needs["Combinatorica`"];  Join[{1}, Table[CycleIndex[DihedralGroup[n], s]/.Table[s[i]->3, {i,1,n}], {n,1,30}]] (* Geoffrey Critzer, Sep 29 2012 *)
    Needs["Combinatorica`"]; Join[{1}, Table[NumberOfNecklaces[n, 3, Dihedral], {n, 30}]] (* T. D. Noe, Oct 02 2012 *)
    mx=40;CoefficientList[Series[(1-Sum[ EulerPhi[n]*Log[1-3*x^n]/n,{n,mx}]+(1+3 x+3 x^2)/(1-3 x^2))/2,{x,0,mx}],x] (* Herbert Kociemba, Nov 02 2016 *)
    t[n_, k_] := (For[t1 = 0; d = 1, d <= n, d++, If[Mod[n, d] == 0, t1 = t1 + EulerPhi[d]*k^(n/d)]]; If[EvenQ[n], (t1 + (n/2)*(1+k)*k^(n/2))/(2*n), (t1 + n*k^((n+1)/2))/(2*n)]); a[0] = 1; a[n_] := t[n, 3]; Array[a, 30, 0] (* Jean-François Alcover, Nov 02 2017, after Maple code for A081720 *)
    k=3; Prepend[Table[DivisorSum[n, EulerPhi[#] k^(n/#) &]/(2n) + (k^Floor[(n+1)/2] + k^Ceiling[(n+1)/2])/4, {n, 1, 30}], 1] (* Robert A. Russell, Sep 24 2018 *)
  • PARI
    a(n,k=3) = if(n==0,1,(k^floor((n+1)/2) + k^ceil((n+1)/2))/4 + (1/(2*n))* sumdiv(n, d, eulerphi(d)*k^(n/d) ) );
    vector(55,n,a(n-1)) \\ Joerg Arndt, Oct 20 2019

Formula

G.f.: (1 - Sum_{n>=1} phi(n)*log(1 - 3*x^n)/n + (1+3*x+3*x^2)/(1-3*x^2))/2. - Herbert Kociemba, Nov 02 2016
For n > 0, a(n) = (k^floor((n+1)/2) + k^ceiling((n+1)/2))/4 + (1/(2*n))* Sum_{d|n} phi(d)*k^(n/d), where k=3 is the maximum number of colors. - Robert A. Russell, Sep 24 2018
a(0) = 1; a(n) = (k^floor((n+1)/2) + k^ceiling((n+1)/2))/4 + (1/(2*n))*Sum_{i=1..n} k^gcd(n,i), where k=3 is the maximum number of colors.
(See A075195 formulas.) - Richard L. Ollerton, May 04 2021
2*a(n) = A182751(n+1) + A001867(n), n>0.

Extensions

More terms from Christian G. Bower

A087854 Triangle read by rows: T(n,k) is the number of n-bead necklaces with exactly k different colored beads.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 4, 9, 6, 1, 6, 30, 48, 24, 1, 12, 91, 260, 300, 120, 1, 18, 258, 1200, 2400, 2160, 720, 1, 34, 729, 5106, 15750, 23940, 17640, 5040, 1, 58, 2018, 20720, 92680, 211680, 258720, 161280, 40320, 1, 106, 5613, 81876, 510312, 1643544, 2963520, 3024000, 1632960, 362880
Offset: 1

Views

Author

Keywords

Comments

Equivalently, T(n,k) is the number of sequences (words) of length n on an alphabet of k letters where each letter of the alphabet occurs at least once in the sequence. Two sequences are considered equivalent if one can be obtained from the other by a cyclic shift of the letters. Cf. A054631 where the surjective restriction is removed. - Geoffrey Critzer, Jun 18 2013
Robert A. Russell's g.f. for column k >= 1 (in the Formula section below) can be proved by integrating both sides of the formula Sum_{n>=1} S2(n, k)*x^(n-1) = x^(k-1)/((1 - x)* (1 - 2*x) * (1 - 3*x) * ... * (1 - k*x)) w.r.t. x. A variation of this identity (valid for |x| < 1/k) can be found in the Formula section of A008277. - Petros Hadjicostas, Aug 20 2019

Examples

			The triangle begins with T(1,1):
  1;
  1,   1;
  1,   2,    2;
  1,   4,    9,     6;
  1,   6,   30,    48,     24;
  1,  12,   91,   260,    300,     120;
  1,  18,  258,  1200,   2400,    2160,     720;
  1,  34,  729,  5106,  15750,   23940,   17640,    5040;
  1,  58, 2018, 20720,  92680,  211680,  258720,  161280,   40320;
  1, 106, 5613, 81876, 510312, 1643544, 2963520, 3024000, 1632960, 362880;
  ...
For T(4,2) = 4, the necklaces are AAAB, AABB, ABAB, and ABBB.
For T(4,4) = 6, the necklaces are ABCD, ABDC, ACBD, ACDB, ADBC, and ADCB.
		

Crossrefs

Diagonals: A000142 and A074143.
Row sums: A019536.
Cf. A000010 (Euler totient phi function), A008277 (Stirling2 numbers), A075195 (table of Jablonski).

Programs

  • Maple
    with(numtheory):
    T:= (n, k)-> (k!/n) *add(phi(d) *Stirling2(n/d, k), d=divisors(n)):
    seq(seq(T(n,k), k=1..n), n=1..12);  # Alois P. Heinz, Jun 19 2013
  • Mathematica
    Table[Table[Sum[EulerPhi[d]*StirlingS2[n/d,k]k!,{d,Divisors[n]}]/n,{k,1,n}],{n,1,10}]//Grid (* Geoffrey Critzer, Jun 18 2013 *)
  • PARI
    T(n, k) = (k!/n) * sumdiv(n, d, eulerphi(d) * stirling(n/d, k, 2)); \\ Joerg Arndt, Sep 25 2020

Formula

T(n,k) = Sum_{i=0..k-1} (-1)^i * C(k,i) * A075195(n,k-i); A075195 = Jablonski's table.
T(n,k) = (k!/n) * Sum_{d|n} phi(d) * S2(n/d, k), where S2(n,k) = Stirling numbers of 2nd kind A008277.
G.f. for column k: -Sum_{d>0} (phi(d)/d) * Sum_{j = 1..k} (-1)^(k-j) * C(k,j) * log(1 - j * x^d). - Robert A. Russell, Sep 26 2018
T(n,k) = Sum_{d|n} A254040(d, k) for n, k >= 1. - Petros Hadjicostas, Aug 19 2019

Extensions

Formula section edited by Petros Hadjicostas, Aug 20 2019

A001869 Number of n-bead necklaces with 5 colors.

Original entry on oeis.org

1, 5, 15, 45, 165, 629, 2635, 11165, 48915, 217045, 976887, 4438925, 20346485, 93900245, 435970995, 2034505661, 9536767665, 44878791365, 211927736135, 1003867701485, 4768372070757, 22706531350485, 108372083629275, 518301258916445
Offset: 0

Views

Author

Keywords

Comments

From Richard L. Ollerton, May 07 2021: (Start)
Here, as in A000031, turning over is not allowed.
(1/n) * Dirichlet convolution of phi(n) and 5^n, n>0. (End)

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 162.
  • 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).
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 7.112(a).

Crossrefs

Column 5 of A075195.
Cf. A054612.

Programs

  • Mathematica
    CoefficientList[Series[1-Sum[EulerPhi[i] Log[1-5*x^i]/i,{i,1,mx}],{x,0,mx}],x] (* Herbert Kociemba, Nov 01 2016 *)
    k=5; Prepend[Table[DivisorSum[n, EulerPhi[#] k^(n/#) &]/n, {n, 1, 30}], 1] (* Robert A. Russell, Sep 21 2018 *)
  • PARI
    a(n) = if (n, sumdiv(n, d, eulerphi(d)*5^(n/d))/n, 1); \\ Michel Marcus, Nov 01 2016

Formula

a(n) = (1/n)*Sum_{d|n} phi(d)*5^(n/d), n > 0.
G.f.: 1 - Sum_{n>=1} phi(n)*log(1 - 5*x^n)/n. - Herbert Kociemba, Nov 01 2016
a(0) = 1; a(n) = (1/n) * Sum_{k=1..n} 5^gcd(n,k). - Ilya Gutkovskiy, Apr 17 2021
a(0) = 1; a(n) = (1/n)*Sum_{k=1..n} 5^(n/gcd(n,k))*phi(gcd(n,k))/phi(n/gcd(n,k)). - Richard L. Ollerton, May 07 2021

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

Views

Author

Keywords

Examples

			For n=2, the ten bracelets are AA, AB, AC, AD, BB, BC, BD, CC, CD, and DD. - _Robert A. Russell_, Sep 24 2018
		

Crossrefs

Column 4 of A051137.

Programs

  • Mathematica
    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 *)

Formula

"DIK" (bracelet, indistinct, unlabeled) transform of 4, 0, 0, 0, ...
Equals (A001868(n) + A056486(n)) / 2 = A001868(n) - A278640(n) = A278640(n) + A056486(n), for n>=1.
a(n) = A081720(n,4), n >= 4. - Wolfdieter Lang, Jun 03 2012
G.f.: (1 - Sum_{n>=1} phi(n)*log(1 - 4*x^n)/n + (1+4*x+6*x^2)/(1-4*x^2))/2. - Herbert Kociemba, Nov 02 2016
a(n) = (k^floor((n+1)/2) + k^ceiling((n+1)/2))/4 + (1/(2*n))* Sum_{d|n} phi(d)*k^(n/d), where k=4 is the maximum number of colors. - Robert A. Russell, Sep 24 2018
a(n) = (k^floor((n+1)/2) + k^ceiling((n+1)/2))/4 + (1/(2*n))*Sum_{i=1..n} k^gcd(n,i), where k=4 is the maximum number of colors. (See A075195 formulas.) - Richard L. Ollerton, May 04 2021
Showing 1-10 of 32 results. Next