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 15 results. Next

A003239 Number of rooted planar trees with n non-root nodes: circularly cycling the subtrees at the root gives equivalent trees.

Original entry on oeis.org

1, 1, 2, 4, 10, 26, 80, 246, 810, 2704, 9252, 32066, 112720, 400024, 1432860, 5170604, 18784170, 68635478, 252088496, 930138522, 3446167860, 12815663844, 47820447028, 178987624514, 671825133648, 2528212128776, 9536895064400, 36054433810102, 136583761444364, 518401146543812
Offset: 0

Views

Author

Keywords

Comments

Also number of necklaces with 2*n beads, n white and n black (to get the correspondence, start at root, walk around outside of tree, use white if move away from the root, black if towards root).
Also number of terms in polynomial expression for permanent of generic circulant matrix of order n.
a(n) is the number of equivalence classes of n-compositions of n under cyclic rotation. (Given a necklace, split it into runs of white followed by a black bead and record the lengths of the white runs. This gives an n-composition of n.) a(n) is the number of n-multisets in Z mod n whose sum is 0. - David Callan, Nov 05 2003
a(n) is the number of cyclic equivalence classes of triangulations of a once-punctured n-gon. - Esther Banaian, May 06 2025

Examples

			As _David Callan_ said, a(n) is the number of n-multisets in Z mod n whose sum is 0. So for n = 4 the a(4)=10 multisets are (0, 0, 0, 0), (1, 1, 1, 1), (0, 1, 1, 2), (0, 0, 2, 2), (2, 2, 2, 2), (0, 0, 1, 3), (1, 2, 2, 3), (1, 1, 3, 3), (0, 2, 3, 3) and (3, 3, 3, 3). - _Boas Bakker_, Apr 21 2025
		

References

  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 305 (see R(x)).
  • F. Harary and E. M. Palmer, Graphical Enumeration, Academic Press, NY, 1973; page 80, Problem 3.13.
  • 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(b).

Crossrefs

Column k=2 of A208183.
Column k=1 of A261494.

Programs

  • Maple
    with(numtheory): A003239 := proc(n) local t1,t2,d; t2 := divisors(n); t1 := 0; for d in t2 do t1 := t1+phi(n/d)*binomial(2*d,d)/(2*n); od; t1; end;
    spec := [ C, {B=Union(Z,Prod(B,B)), C=Cycle(B)}, unlabeled ]; [seq(combstruct[count](spec, size=n), n=0..40)];
  • Mathematica
    a[n_] := Sum[ EulerPhi[n/k]*Binomial[2k, k]/(2n), {k, Divisors[n]}]; a[0] = 1; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Apr 11 2012 *)
  • PARI
    C(n, k)=binomial(n,k);
    a(n) = if(n<=0, n==0, sumdiv(n, d, eulerphi(n/d) * C(2*d, d)) / (2*n) );
    /* or, second formula: */
    /* a(n) = if(n<=0, n==0, sumdiv(n, d, eulerphi(n/d) * C(2*d-1,d)) / n ); */
    /* Joerg Arndt, Oct 21 2012 */
    
  • SageMath
    def A003239(n):
        if n == 0: return 1
        return sum(euler_phi(n/d)*binomial(2*d, d)/(2*n) for d in divisors(n))
    print([A003239(n) for n in (0..29)]) # Peter Luschny, Dec 10 2020

Formula

a(n) = Sum_{d|n} (phi(n/d)*binomial(2*d, d))/(2*n) for n > 0.
a(n) = (1/n)*Sum_{d|n} (phi(n/d)*binomial(2*d-1, d)) for n > 0.
a(n) = A047996(2*n, n). - Philippe Deléham, Jul 25 2006
a(n) ~ 2^(2*n-1) / (sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Aug 22 2015

Extensions

Sequence corrected and extended by Roderick J. Fletcher (yylee(AT)mail.ncku.edu.tw), Aug 1997
Additional comments from Michael Somos

A137729 Number of circular permutations of the multiset {1,1,2,2,...,n,n} (up to rotations).

Original entry on oeis.org

1, 1, 2, 16, 318, 11352, 623760, 48648960, 5108105520, 694702028160, 118794043549440, 24946749109094400, 6311527524161798400, 1893458257242791500800, 664603848292138865510400, 269829162406607158901145600
Offset: 0

Views

Author

Max Alekseyev, Feb 09 2008

Keywords

Crossrefs

Row n=2 of A208183.

Formula

a(n) = ((2*n)!/2^n + n!) / (2*n).

Extensions

a(0)=1 prepended by Alois P. Heinz, Jul 28 2015

A118644 Number of distinct (n red, n blue, n green)-bead necklaces.

Original entry on oeis.org

1, 2, 16, 188, 2896, 50452, 953056, 19003476, 394397776, 8439756848, 185033251616, 4137181680700, 94020327215200, 2166105078791448, 50489825388328608, 1188777328563914488, 28236363841989180496, 675879582290807439796, 16289254212704277185152
Offset: 0

Views

Author

Jacob A. Siehler, May 10 2006

Keywords

Crossrefs

Cf. A003239.
Column k=3 of A208183.

Programs

  • Mathematica
    f[n_] := Plus @@ (EulerPhi[n/# ]Binomial[3#, # ]Binomial[2#, # ] & /@ Divisors[n])/(3n)

Formula

Sum_{d|n} ( phi(n/d)(3d Choose d)(2d Choose d) )/3n for n>0. [Corrected by several correspondents, Mar 04 2010]
a(n) ~ 3^(3*n-1/2) / (2*Pi*n^2). - Vaclav Kotesovec, Aug 23 2015

A207816 Number of distinct necklaces with n red, n green, n blue and n white beads.

Original entry on oeis.org

1, 6, 318, 30804, 3941598, 586637256, 96197661156, 16875655269948, 3111284141045598, 595909785174057204, 117634021777132574568, 23797087019979071174580, 4912693780461352534397604, 1031629572413246016139181544, 219809927417367534490107035244, 47426945434432859336092700072304
Offset: 0

Views

Author

Keywords

Examples

			For n=1, a(1)=6 since for four beads necklaces with each bead from each of the four colors say (R,G,B,W), we can arrange as following, [R,G,B,W], [R,G,W,B], [R,B,G,W], [R,B,W,G], [R,W,G,B] and [R,W,B,G].
		

Crossrefs

Column k=4 of A208183. - Alois P. Heinz, Feb 24 2012

Programs

  • Maple
    with(combinat): with(numtheory):
    # This formula comes from Polya Counting Theorem:
    # Z(C_n) = add(phi(d)*(a_d)^(n/d), d in divisors(n))/n;
    PolyaBrace:= proc(S) option remember; local n, s, d;
                   n:= add(s, s=S);
                   add(phi(d) *PolyaCoeff(d, S), d=divisors(n))/n
                 end:
    # Find coeff of prod(a[i]^s[i], i=1..n) of a_d^(n/d) (symmetric function)
    PolyaCoeff:= proc(d, S) option remember; local n, pow, s;
                   n:= add(s, s=S);
                   pow:= n/d;
                   if {seq(s mod d, s = S)} = {0}
                      then multinomial(pow, seq(s/d, s = S))
                      else 0
                   fi:
                 end:
    a:= n-> `if`(n=0, 1, PolyaBrace([n$4])):
    seq(a(n), n=0..20);
  • Mathematica
    a[n_] := DivisorSum[n, EulerPhi[n/#] (4#)!/(#!^4 * 4n)&]; a[0]=1;
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Mar 24 2017, after Alois P. Heinz *)

Formula

a(n) = Sum_{d|n} phi(n/d)*(4*d)!/(d!^4*4*n) if n>0 and a(0) = 1. - Alois P. Heinz, Feb 24 2012
a(n) ~ 2^(8*n-5/2) / (Pi^(3/2) * n^(5/2)). - Vaclav Kotesovec, Aug 23 2015

A208184 Number of distinct n-colored necklaces with 3 beads per color.

Original entry on oeis.org

1, 1, 4, 188, 30804, 11211216, 7623616080, 8690922240480, 15391623287043360, 40018220546304026880, 146226577876194816241920, 725283826265926287362419200, 4746982642910487550771226611200, 40045545575592872978305843519334400
Offset: 0

Views

Author

Alois P. Heinz, Feb 24 2012

Keywords

Examples

			a(0) = 1: the empty necklace.
a(1) = 1: {000}.
a(2) = 4: {000111, 001011, 010011, 010101}.
		

Crossrefs

Row n=3 of A208183.

Programs

  • Maple
    with(numtheory);
    a:= n-> `if`(n=0, 1, add(phi(3/d) *(n*d)!/(d!^n *3*n), d={1, 3})):
    seq(a(n), n=0..20);
  • Mathematica
    Flatten[{1, Table[(3*n)!/(3*n*6^n) + 2*(n-1)!/3, {n, 1, 20}]}] (* Vaclav Kotesovec, Aug 23 2015 *)

Formula

a(n) = Sum_{d|3} phi(3/d)*(n*d)!/(d!^n*n*3) if n>0 and a(0) = 1.
For n > 0, a(n) = (3*n)!/(3*n*6^n) + 2*(n-1)!/3. - Vaclav Kotesovec, Aug 23 2015

A208185 Number of distinct n-colored necklaces with 4 beads per color.

Original entry on oeis.org

1, 1, 10, 2896, 3941598, 15277017432, 135277939358160, 2374127830286012160, 74701932179186551241520, 3911393168902074440088524160, 321715999535364496261149134365440, 39702971502659332476270701578180454400, 7081620512071831837127802029303335215878400
Offset: 0

Views

Author

Alois P. Heinz, Feb 24 2012

Keywords

Examples

			a(0) =  1: the empty necklace.
a(1) =  1: {0000}.
a(2) = 10: {00001111, 00010111, 00100111, 01000111, 00011011, 00110011, 00101011, 01010011, 01001011, 01010101}.
		

Crossrefs

Row n=4 of A208183.

Programs

  • Maple
    with(numtheory);
    a:= n-> `if`(n=0, 1, add(phi(4/d) *(n*d)!/(d!^n *4*n), d={1,2,4})):
    seq(a(n), n=0..15);
  • Mathematica
    Flatten[{1, Table[(4*n)!/(4*n*24^n) + (n-1)!/2 + (2*n-1)!/2^(n+1), {n, 1, 15}]}] (* Vaclav Kotesovec, Aug 23 2015 *)

Formula

a(n) = Sum_{d|4} phi(4/d)*(n*d)!/(d!^n*n*4) if n>0 and a(0) = 1.
For n > 0, a(n) = (4*n)!/(4*n*24^n) + (n-1)!/2 + (2*n-1)!/2^(n+1). - Vaclav Kotesovec, Aug 23 2015

A208186 Number of distinct n-colored necklaces with 5 beads per color.

Original entry on oeis.org

1, 1, 26, 50452, 586637256, 24934429725024, 2961088201992945120, 823940558733748910598720, 474389544274867071519255599040, 515190840198859838606483730223480320, 982409170121762644481286121423409538362880, 3106878824601775580798512171862746898249905228800
Offset: 0

Views

Author

Alois P. Heinz, Feb 24 2012

Keywords

Examples

			a(0) =  1: the empty necklace.
a(1) =  1: {00000}.
a(2) = 26: {0000011111, ..., 0101010101}.
		

Crossrefs

Row n=5 of A208183.

Programs

  • Maple
    with(numtheory);
    a:= n-> `if`(n=0, 1, add(phi(5/d) *(n*d)!/(d!^n *5*n), d={1, 5})):
    seq(a(n), n=0..12);

Formula

a(n) = Sum_{d|5} phi(5/d)*(n*d)!/(d!^n*n*5) if n>0 and a(0) = 1.

A208187 Number of distinct n-colored necklaces with 6 beads per color.

Original entry on oeis.org

1, 1, 80, 953056, 96197661156, 45695805591924048, 74171603795480180204640, 333504309246734399617946903040, 3581026866351385580856518554063502880, 82211352663724607444625251063583157979101440, 3704235885150602243096407788053997013140363354216960
Offset: 0

Views

Author

Alois P. Heinz, Feb 24 2012

Keywords

Examples

			a(0) =  1: the empty necklace.
a(1) =  1: {000000}.
a(2) = 80: {000000111111, ..., 010101010101}.
		

Crossrefs

Row n=6 of A208183.

Programs

  • Maple
    with(numtheory);
    a:= n-> `if`(n=0, 1, add(phi(6/d) *(n*d)!/(d!^n *6*n), d={1, 2, 3, 6})):
    seq(a(n), n=0..12);

Formula

a(n) = Sum_{d|6} phi(6/d)*(n*d)!/(d!^n*n*6) if n>0 and a(0) = 1.

A208188 Number of distinct n-colored necklaces with 7 beads per color.

Original entry on oeis.org

1, 1, 246, 19003476, 16875655269948, 90784545100668913392, 2041012695880532470281654960, 150277870737901828652705825755721760, 30495546426686489361833408314854897254404320, 14997592385781765578538605874290442908069285068834560
Offset: 0

Views

Author

Alois P. Heinz, Feb 24 2012

Keywords

Examples

			a(0) =   1: the empty necklace.
a(1) =   1: {0000000}.
a(2) = 246: {00000001111111, ..., 01010101010101}.
		

Crossrefs

Row n=7 of A208183.

Programs

  • Maple
    with(numtheory);
    a:= n-> `if`(n=0, 1, add(phi(7/d) *(n*d)!/(d!^n *7*n), d={1, 7})):
    seq(a(n), n=0..12);

Formula

a(n) = Sum_{d|7} phi(7/d)*(n*d)!/(d!^n*n*7) if n>0 and a(0) = 1.

A208189 Number of distinct n-colored necklaces with 8 beads per color.

Original entry on oeis.org

1, 1, 810, 394397776, 3111284141045598, 191417861328837588057432, 60192781171721237282811209918160, 73288704867601350013562616043249358012160, 283839436431731355577562936415156522873876247241520, 3019803425783983174717206845130801781814711776972408728524160
Offset: 0

Views

Author

Alois P. Heinz, Feb 24 2012

Keywords

Examples

			a(0) =   1: the empty necklace.
a(1) =   1: {00000000}.
a(2) = 810: {0000000011111111, ..., 0101010101010101}.
		

Crossrefs

Row n=8 of A208183.

Programs

  • Maple
    with(numtheory);
    a:= n-> `if`(n=0, 1, add(phi(8/d) *(n*d)!/(d!^n *8*n), d={1, 2, 4, 8})):
    seq(a(n), n=0..10);

Formula

a(n) = Sum_{d|8} phi(8/d)*(n*d)!/(d!^n*n*8) if n>0 and a(0) = 1.
Showing 1-10 of 15 results. Next