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.

Previous Showing 61-70 of 96 results. Next

A032242 Number of identity bracelets of n beads of 5 colors.

Original entry on oeis.org

5, 10, 10, 45, 252, 1120, 5270, 23475, 106950, 483504, 2211650, 10148630, 46911060, 217863040, 1017057256, 4767774375, 22438419120, 105960830300, 501928967930, 2384170903140, 11353241255900
Offset: 1

Views

Author

Keywords

Comments

For n>2 also number of asymmetric bracelets with n beads of five colors. - Herbert Kociemba, Nov 29 2016

Crossrefs

Column k=5 of A309528 for n >= 3.

Programs

  • Maple
    N:= 50: # for a(1)..a(N)
    G:= add(1/2*numtheory:-mobius(n)*(-log(1-5*x^n)/n - add(binomial(5,i)*x^(n*i)/(1-5*x^(2*n)),i=0..2)), n=1..N):
    S:= series(G,x,N+1):
    5,10,seq(coeff(S,x,j),j=3..N); # Robert Israel, Jun 24 2019
  • Mathematica
    m=5; (* 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/(2d))/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,5],{x,0,mx}],x]],{1->5,2->10}] (* Herbert Kociemba, Nov 29 2016 *)
  • PARI
    a(n)={if(n<3, binomial(5,n), sumdiv(n, d, moebius(n/d)*(5^d/n - if(d%2, 5^((d+1)/2), 3*5^(d/2))))/2)} \\ Andrew Howroyd, Sep 12 2019

Formula

"DHK" (bracelet, identity, unlabeled) transform of 5, 0, 0, 0...
From Herbert Kociemba, Nov 29 2016: (Start)
More generally, gf(k) is the g.f. for the number of asymmetric bracelets with n beads of k colors.
gf(k): Sum_{n>=1} mu(n)*( -log(1-k*x^n)/n - Sum_{i=0..2} binomial(k,i)x^(n*i)/(1-k*x^(2*n)) )/2. (End)

A136704 Number of Lyndon words on {1,2,3} with an odd number of 1's and an odd number of 2's.

Original entry on oeis.org

0, 1, 2, 5, 12, 30, 78, 205, 546, 1476, 4026, 11070, 30660, 85410, 239144, 672605, 1899120, 5380830, 15292914, 43584804, 124527988, 356602950, 1023295422, 2941974270, 8472886092, 24441017580, 70607383938
Offset: 1

Views

Author

Jennifer Woodcock (jennifer.woodcock(AT)ugdsb.on.ca), Jan 16 2008

Keywords

Comments

This sequence is also the number of Lyndon words on {1,2,3} with an even number of 1's and an odd number of 2's except that a(1) = 1 in this case.
Also, a Lyndon word is the aperiodic necklace representative which is lexicographically earliest among its cyclic shifts. Thus we can apply the fixed density formulas: L_k(n,d) = Sum L(n-d, n_1,..., n_(k-1)); n_1 + ... +n_(k-1) = d where L(n_0, n_1,...,n_(k-1)) = (1/n) Sum mu(j)*[(n/j)!/((n_0/j)!(n_1/j)!...(n_(k-1)/j)!)]; j|gcd(n_0, n_1,...,n_(k-1)). For this sequence, sum over n_0, n_1 = odd.

Examples

			For n = 3, out of 8 possible Lyndon words: 112, 113, 122, 123, 132, 133, 223, 233, only 123 and 132 have an odd number of both 1's and 2's. Thus a(3) = 2.
		

References

  • M. Lothaire, Combinatorics on Words, Addison-Wesley, Reading, MA, 1983.

Crossrefs

Programs

  • Mathematica
    a[1] = 0;
    a[n_] := If[OddQ[n], Sum[MoebiusMu[d] * 3^(n/d), {d, Divisors[n]}], Sum[Boole[OddQ[d]] MoebiusMu[d] * (3^(n/d)-1), {d, Divisors[n]}]]/(4n);
    Array[a, 27] (* Jean-François Alcover, Aug 26 2019 *)
  • PARI
    a(n) = if (n==1, 0, if (n % 2, sumdiv(n, d, moebius(d)*3^(n/d))/(4*n), sumdiv(n, d, if (d%2, moebius(d)*(3^(n/d)-1)))/(4*n))); \\ Michel Marcus, Aug 26 2019

Formula

a(1) = 0; for n>1, if n = odd then a(n) = Sum_{d|n} (mu(d)*3^(n/d))/(4n). If n = even, then a(n) = Sum_{d|n, d odd} (mu(d)*(3^(n/d)-1))/(4n).

A261531 Number of necklaces with n beads of unlabeled colors such that the numbers of beads per color are distinct.

Original entry on oeis.org

1, 1, 1, 2, 2, 4, 15, 25, 69, 254, 1799, 4039, 16828, 61751, 349831, 3485031, 10391139, 49433136, 240065255, 1282012987, 9167583734, 131550812011, 459677216341, 2707382738559, 14318807603110, 94084166753927, 601900541251447, 5894253303715375
Offset: 0

Views

Author

Alois P. Heinz, Aug 23 2015

Keywords

Examples

			a(4) = 2: 0000, 0001.
a(5) = 4: 00000, 00001, 00011, 00101.
a(6) = 15: 000000, 000001, 000011, 000101, 000112, 000121, 000122, 001001, 001012, 001021, 001022, 001102, 001201, 001202, 010102.
		

Crossrefs

Programs

  • Maple
    with(numtheory): with(combinat):
    g:= l-> (n-> `if`(n=0, 1, add(phi(j)*multinomial(n/j,
            (l/j)[]), j=divisors(igcd(l[])))/n))(add(i, i=l)):
    b:= proc(n, i, l) `if`(i*(i+1)/2n, 0, b(n-i, i-1, [l[], i]))))
        end:
    a:= n-> b(n$2, []):
    seq(a(n), n=0..35);
  • Mathematica
    multinomial[n_, k_] := n!/Times @@ (k!);
    g[l_] := Function[n, If[n==0, 1, Sum[EulerPhi[j]*multinomial[n/j, l/j], {j, Divisors[GCD @@ l]}]/n]][Total[l]];
    b[n_, i_, l_] := If[i*(i+1)/2n, 0, b[n-i, i-1, Append[l, i]]]]];
    a[n_] := b[n, n, {}];
    Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Mar 21 2017, translated from Maple *)
  • PARI
    a(n)={if(n==0, 1, my(p=prod(k=1, n, (1+x^k/k!) + O(x*x^n))); sumdiv(n, d, eulerphi(n/d)*d!*polcoeff(p, d))/n)} \\ Andrew Howroyd, Dec 21 2017

Formula

a(n) = (1/n) * Sum_{d | n} phi(n/d) * A007837(d) for n>0. - Andrew Howroyd, Apr 02 2017

A261599 Number of primitive (aperiodic, or Lyndon) necklaces with n beads of unlabeled colors such that the numbers of beads per color are distinct.

Original entry on oeis.org

1, 1, 0, 1, 1, 3, 13, 24, 67, 252, 1795, 4038, 16812, 61750, 349806, 3485026, 10391070, 49433135, 240064988, 1282012986, 9167581934, 131550811985, 459677212302, 2707382738558, 14318807586215, 94084166753923, 601900541189696, 5894253303715121
Offset: 0

Views

Author

Alois P. Heinz, Aug 25 2015

Keywords

Examples

			a(4) = 1: 0001.
a(5) = 3: 00001, 00011, 00101.
a(6) = 13: 000001, 000011, 000101, 000112, 000121, 000122, 001012, 001021, 001022, 001102, 001201, 001202, 010102.
a(7) = 24: 0000001, 0000011, 0000101, 0000111, 0000112, 0000121, 0000122, 0001001, 0001011, 0001012, 0001021, 0001022, 0001101, 0001102, 0001201, 0001202, 0010011, 0010012, 0010021, 0010022, 0010101, 0010102, 0010201, 0010202.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    b:= proc(n, i, g, d, j) option remember; `if`(i*(i+1)/20
           and gn, 0, binomial(n/j, i/j)*b(n-i, i-1, igcd(i, g), d, j))))
        end:
    a:= n-> `if`(n=0, 1, add(add((f-> `if`(f=0, 0, f*b(n$2, 0, d, j)))(
                         mobius(j)), j=divisors(d)), d=divisors(n))/n):
    seq(a(n), n=0..30);
  • Mathematica
    a[0] = 1; a[n_] := With[{P = Product[1 + x^k/k!, {k, 1, n}] + O[x]^(n+1) // Normal}, DivisorSum[n, MoebiusMu[n/#]*#!*Coefficient[P, x, #]&]/n];
    Table[a[n], {n, 0, 30}] (* Jean-François Alcover, May 28 2018, after Andrew Howroyd *)
  • PARI
    a(n)={if(n==0, 1, my(p=prod(k=1, n, (1+x^k/k!) + O(x*x^n))); sumdiv(n, d, moebius(n/d)*d!*polcoeff(p, d))/n)} \\ Andrew Howroyd, Dec 21 2017

Formula

a(n) = (1/n) * Sum_{d | n} moebius(n/d) * A007837(d) for n>0. - Andrew Howroyd, Dec 21 2017

A280303 Number of binary necklaces of length n with no subsequence 00000.

Original entry on oeis.org

1, 2, 3, 5, 7, 12, 17, 31, 51, 91, 155, 287, 505, 930, 1695, 3129, 5759, 10724, 19913, 37239, 69643, 130745, 245715, 463099, 873705, 1651838, 3126707, 5927817, 11251031, 21382558, 40679233, 77475673, 147694719, 281822847, 538213671, 1028714071, 1967728553
Offset: 1

Views

Author

Petros Hadjicostas and Lingyun Zhang, Dec 31 2016

Keywords

Comments

a(n) is the number of cyclic sequences of length n consisting of zeros and ones that do not contain five consecutive zeros provided we consider as equivalent those sequences that are cyclic shifts of each other.

Examples

			a(5)=7 because we have seven binary cyclic sequences (necklaces) of length 5 that avoid five consecutive zeros: 00001, 00011, 00101, 00111, 01101, 01111, 11111.
		

Crossrefs

Formula

a(n) = (1/n) * Sum_{d divides n} totient(n/d) * A074048(d).
G.f.: Sum_{k>=1} (phi(k)/k) * log(1/(1-B(x^k))) where B(x) = x*(1+x+x^2+x^3+x^4).

Extensions

a(34) onwards from Andrew Howroyd, Jan 25 2024

A005516 Number of n-bead bracelets (turnover necklaces) with 12 red beads.

Original entry on oeis.org

1, 1, 7, 19, 72, 196, 561, 1368, 3260, 7105, 14938, 29624, 56822, 104468, 186616, 322786, 544802, 896259, 1444147, 2278640, 3532144, 5380034, 8070400, 11926928, 17393969, 25042836, 35638596, 50152013, 69855536
Offset: 12

Views

Author

Keywords

Comments

From Vladimir Shevelev, Apr 23 2011: (Start)
Also number of non-equivalent (turnover) necklaces of 12 beads each of them painted by one of n colors.
The sequence solves the so-called Reis problem about convex k-gons in case k=12 (see our comment to A032279). (End)

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Column k=12 of A052307.

Programs

  • Mathematica
    k = 12; 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 *)
    k=12;CoefficientList[Series[x^k*(1/k Plus@@(EulerPhi[#] (1-x^#)^(-(k/#))&/@Divisors[k])+(1+x)/(1-x^2)^Floor[k/2+1])/2,{x,0,50}],x] (* Herbert Kociemba, Nov 04 2016 *)

Formula

Let s(n,k,d) = 1, if n==k (mod d), s(n,k,d) = 0, otherwise. Then a(n) = s(n,0,12)/6 + (n-6)*s(n,0,6)/72 + (n-4)*(n-8)*s(n,0,4)/384 + (n-3)*(n-6)*(n-9)*s(n,0,3)/1944 + (3840*C(n-1,11) + (n+1)*(n-2)*(n-4)*(n-6)*(n-8)*(n-10))/92160, if n is even; a(n) = (n-3)*(n-6)*(n-9)*s(n,0,3)/1944 + (3840*C(n-1,11) + (n-1)*(n-3)*(n-5)*(n-7)*(n-9)*(n-11))/92160, if n is odd. - Vladimir Shevelev, Apr 23 2011
From Herbert Kociemba, Nov 04 2016: (Start)
G.f.: 1/2*x^12*((1+x)/(1-x^2)^7 + 1/12*(1/(-1+x)^12 + 1/(-1+x^2)^6 + 2/(-1+x^3)^4 - 2/(-1+x^4)^3 + 2/(-1+x^6)^2 - 4/(-1+x^12))).
G.f.: k=12, x^k*((1/k)*(Sum_{d|k} phi(d)*(1 - x^d)^(-k/d)) + (1 + x)/(1 -x^2)^floor((k+2)/2))/2. (End)

Extensions

Sequence extended and description corrected by Christian G. Bower

A005654 Number of bracelets (turn over necklaces) with n red, 1 pink and n-1 blue beads; also reversible strings with n red and n-1 blue beads; also next-to-central column in Losanitsch's triangle A034851.

Original entry on oeis.org

1, 2, 6, 19, 66, 236, 868, 3235, 12190, 46252, 176484, 676270, 2600612, 10030008, 38781096, 150273315, 583407990, 2268795980, 8836340260, 34461678394, 134564560988, 526024917288, 2058358034616, 8061901596814, 31602652961516, 123979635837176, 486734861612328
Offset: 1

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A034851.

Programs

  • Magma
    [((Binomial(2*n-1, n)+Binomial(n-1, Floor(n/2)))/2): n in [1..30]]; // Vincenzo Librandi, May 24 2012
  • Maple
    A005654:=n->(1/2)*(binomial(2*n-1,n)+binomial(n-1,floor(n/2))): seq(A005654(n), n=1..40); # Wesley Ivan Hurt, Jan 29 2017
  • Mathematica
    Table[(Binomial[2n-1,n]+Binomial[n-1,Floor[n/2]])/2,{n,30}] (* Harvey P. Dale, May 17 2012 *)
  • PARI
    C(n,k)=binomial(n,k)
    a(n)=(1/2)*(C(2*n-1,n)+C(n-1,n\2))
    

Formula

a(n) = (1/2) * (binomial(2*n-1, n) + binomial(n-1, floor(n/2))). - Michael Somos
a(n) = A034851(2*n-1, n-1).
Conjecture: n*(n-2)*a(n) - (5*n-3)*(n-2)*a(n-1) + 4*(n-2)*a(n-2) + 4*(5*n^2-27*n+37)*a(n-3) - 8*(2*n-7)*(n-4)*a(n-4) = 0. - R. J. Mathar, Nov 09 2013

Extensions

Sequence extended and description corrected by Christian G. Bower

A032165 Number of aperiodic necklaces of n beads of 10 colors.

Original entry on oeis.org

10, 45, 330, 2475, 19998, 166485, 1428570, 12498750, 111111000, 999989991, 9090909090, 83333249175, 769230769230, 7142856428565, 66666666659934, 624999993750000, 5882352941176470, 55555555499944500
Offset: 1

Views

Author

Keywords

Crossrefs

Column 10 of A074650.

Programs

  • Mathematica
    f[d_]:=MoebiusMu[d] 10^(n/d)/n; a[n_]:=Total[f/@Divisors[n]]; a[0]=1; Table[a[n], {n, 1, 20}] (* Vincenzo Librandi, Oct 14 2017 *)
  • PARI
    a(n) = sumdiv(n, d, moebius(d)*10^(n/d))/n; \\ Andrew Howroyd, Oct 13 2017

Formula

"CHK" (necklace, identity, unlabeled) transform of 10, 0, 0, 0...
a(n) = Sum_{d|n} mu(d)*10^(n/d)/n.
G.f.: Sum_{k>=1} mu(k)*log(1/(1 - 10*x^k))/k. - Ilya Gutkovskiy, May 19 2019

A032166 Number of aperiodic necklaces of n beads of 11 colors.

Original entry on oeis.org

11, 55, 440, 3630, 32208, 295020, 2783880, 26793030, 261994040, 2593726344, 25937424600, 261535549220, 2655593241840, 27124986721140, 278483211283552, 2871858103075830, 29732178147017280
Offset: 1

Views

Author

Keywords

Comments

Number of monic irreducible polynomials of degree n over GF(11). # Robert Israel, Jan 07 2015

Crossrefs

Column 11 of A074650.

Programs

  • Maple
    f:= (n,p) -> add(numtheory:-mobius(d)*p^(n/d),d=numtheory:-divisors(n))/n:
    seq(f(n,11), n=1..100); # Robert Israel, Jan 07 2015
  • Mathematica
    f[d_]:=MoebiusMu[d] 11^(n/d)/n; a[n_]:=Total[f/@Divisors[n]]; a[0]=1; Table[a[n], {n, 1, 30}] (* Vincenzo Librandi, Oct 14 2017 *)
  • PARI
    a(n) = sumdiv(n, d, moebius(d)*11^(n/d))/n; \\ Michel Marcus, Jan 07 2015

Formula

"CHK" (necklace, identity, unlabeled) transform of 11, 0, 0, 0...
a(n) = Sum_{d|n} mu(d)*11^(n/d)/n.
G.f.: Sum_{k>=1} mu(k)*log(1/(1 - 11*x^k))/k. - Ilya Gutkovskiy, May 19 2019

A032167 Number of aperiodic necklaces of n beads of 12 colors.

Original entry on oeis.org

12, 66, 572, 5148, 49764, 497354, 5118828, 53745120, 573308736, 6191711526, 67546215516, 743008120140, 8230246567620, 91708459194066, 1027134771622388, 11555266154065920, 130506535690613940
Offset: 1

Views

Author

Keywords

Crossrefs

Column 12 of A074650.

Programs

  • Mathematica
    f[d_]:=MoebiusMu[d] 12^(n/d)/n; a[n_]:=Total[f/@Divisors[n]]; a[0]=1; Table[a[n], {n, 1, 30}] (* Vincenzo Librandi, Oct 14 2017 *)

Formula

"CHK" (necklace, identity, unlabeled) transform of 12, 0, 0, 0...
a(n) = Sum_{d|n} mu(d)*12^(n/d)/n.
G.f.: Sum_{k>=1} mu(k)*log(1/(1 - 12*x^k))/k. - Ilya Gutkovskiy, May 19 2019
Previous Showing 61-70 of 96 results. Next