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-4 of 4 results.

A001429 Number of n-node connected unicyclic graphs.

Original entry on oeis.org

1, 2, 5, 13, 33, 89, 240, 657, 1806, 5026, 13999, 39260, 110381, 311465, 880840, 2497405, 7093751, 20187313, 57537552, 164235501, 469406091, 1343268050, 3848223585, 11035981711, 31679671920, 91021354454, 261741776369, 753265624291, 2169441973139, 6252511838796
Offset: 3

Views

Author

Keywords

Comments

Also unlabeled connected simple graphs with n vertices and n edges. The labeled version is A057500. - Gus Wiseman, Feb 12 2024

Examples

			From _Gus Wiseman_, Feb 12 2024: (Start)
Representatives of the a(3) = 1 through a(6) = 13 simple graphs:
  {12,13,23}  {12,13,14,23}  {12,13,14,15,23}  {12,13,14,15,16,23}
              {12,13,24,34}  {12,13,14,23,25}  {12,13,14,15,23,26}
                             {12,13,14,23,45}  {12,13,14,15,23,46}
                             {12,13,14,25,35}  {12,13,14,15,26,36}
                             {12,13,24,35,45}  {12,13,14,23,25,36}
                                               {12,13,14,23,25,46}
                                               {12,13,14,23,45,46}
                                               {12,13,14,23,45,56}
                                               {12,13,14,25,26,35}
                                               {12,13,14,25,35,46}
                                               {12,13,14,25,35,56}
                                               {12,13,14,25,36,56}
                                               {12,13,24,35,46,56}
(End)
		

References

  • R. C. Read and R. J. Wilson, An Atlas of Graphs, Oxford, 1998.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 150.
  • 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).

Crossrefs

For at most one cycle we have A005703, labeled A129271, complement A140637.
Next-to-main diagonal of A054924. Cf. A000055.
The labeled version is A057500, connected case of A137916.
This is the connected case of A137917 and A236570.
Row k = 1 of A137918.
The version with loops is A368983.
A001349 counts unlabeled connected graphs.
A001434 and A006649 count unlabeled graphs with # vertices = # edges.
A006129 counts covering graphs, unlabeled A002494.

Programs

  • Mathematica
    Needs["Combinatorica`"];
    nn=30;s[n_,k_]:=s[n,k]=a[n+1-k]+If[n<2k,0,s[n-k,k]];a[1]=1;a[n_]:=a[n]=Sum[a[i]s[n-1,i]i,{i,1,n-1}]/(n-1);rt=Table[a[i],{i,1,nn}];Apply[Plus,Table[Take[CoefficientList[CycleIndex[DihedralGroup[n],s]/.Table[s[j]->Table[Sum[rt[[i]]x^(k*i),{i,1,nn}],{k,1,nn}][[j]],{j,1,nn}],x],nn],{n,3,nn}]]  (* Geoffrey Critzer, Oct 12 2012, after code given by Robert A. Russell in A000081 *)
    (* Second program: *)
    TreeGf[nn_] := Module[{A}, A = Table[1, {nn}]; For[n = 1, n <= nn 1, n++, A[[n + 1]] = 1/n * Sum[Sum[ d*A[[d]], {d, Divisors[k]}]*A[[n - k + 1]], {k, 1, n}]]; x A.x^Range[0, nn-1]];
    seq[n_] := Module[{t, g}, If[n < 3, {}, t = TreeGf[n - 2]; g[e_] := Normal[t + O[x]^(Quotient[n, e]+1)] /. x -> x^e  + O[x]^(n+1); Sum[Sum[ EulerPhi[d]*g[d]^(k/d), {d, Divisors[k]}]/k + If[OddQ[k], g[1]* g[2]^Quotient[k, 2], (g[1]^2 + g[2])*g[2]^(k/2-1)/2], {k, 3, n}]]/2 // Drop[CoefficientList[#, x], 3]&];
    seq[32] (* Jean-François Alcover, Oct 05 2019, after Andrew Howroyd's PARI code *)
  • PARI
    \\ TreeGf gives gf of A000081
    TreeGf(N)={my(A=vector(N, j, 1)); for (n=1, N-1, A[n+1] = 1/n * sum(k=1, n, sumdiv(k, d, d*A[d]) * A[n-k+1] ) ); x*Ser(A)}
    seq(n)={if(n<3, [], my(t=TreeGf(n-2)); my(g(e)=subst(t + O(x*x^(n\e)),x,x^e) + O(x*x^n)); Vec(sum(k=3, n, sumdiv(k, d, eulerphi(d)*g(d)^(k/d))/k + if(k%2, g(1)*g(2)^(k\2), (g(1)^2+g(2))*g(2)^(k/2-1)/2))/2))} \\ Andrew Howroyd, May 05 2018

Formula

a(n) = A068051(n) - A027852(n) - A000081(n).

Extensions

More terms from Ronald C. Read
a(27) corrected, more terms, formula from Christian G. Bower, Feb 12 2002
Edited by Charles R Greathouse IV, Oct 05 2009
Terms a(30) and beyond from Andrew Howroyd, May 05 2018

A217781 Triangular array read by rows: T(n,k) is the number of n-node connected graphs with exactly one cycle of length k (and no other cycles) for n >= 1 and 1 <= k <= n.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 4, 3, 1, 1, 9, 6, 3, 1, 1, 20, 16, 7, 4, 1, 1, 48, 37, 18, 9, 4, 1, 1, 115, 96, 44, 28, 10, 5, 1, 1, 286, 239, 117, 71, 32, 13, 5, 1, 1, 719, 622, 299, 202, 89, 45, 14, 6, 1, 1, 1842, 1607, 793, 542, 264, 130, 52, 17, 6, 1, 1
Offset: 1

Views

Author

Geoffrey Critzer, Mar 24 2013

Keywords

Comments

Note that the structures counted in columns 1 and 2 are not simple graphs as we are allowing a self loop (column 1) and a double edge (column 2).

Examples

			Triangle begins:
    1;
    1,   1;
    2,   1,   1;
    4,   3,   1,   1;
    9,   6,   3,   1,   1;
   20,  16,   7,   4,   1,   1;
   48,  37,  18,   9,   4,   1,   1;
  115,  96,  44,  28,  10,   5,   1,   1;
  286, 239, 117,  71,  32,  13,   5,   1,   1;
  ...
		

Crossrefs

Cf. A068051 (row sums), A001429 (row sums for columns >= 3).
Cf. A000081 (column 1), A027852 (column 2), A000226 (column 3), A000368 (column 4).
Cf. A339428 (directed cycle).

Programs

  • Mathematica
    nn=15;f[list_]:=Select[list,#>0&];t[x_]:=Sum[a[n]x^n,{n,0,nn}];sol=SolveAlways[0==Series[t[x]-x Product[1/(1-x^i)^a[i],{i,1,nn}],{x,0,nn}],x];b=Table[a[n],{n,1,nn}]/.sol//Flatten;Map[f,Drop[Transpose[Table[Take[CoefficientList[CycleIndex[DihedralGroup[n],s]/.Table[s[j]->Table[Sum[b[[i]]x^(i*k),{i,1,nn}],{k,1,nn}][[j]],{j,1,n}],x],nn],{n,1,nn}]],1]]//Grid
  • PARI
    \\ TreeGf is A000081 as g.f.
    TreeGf(N) = {my(A=vector(N, j, 1)); for (n=1, N-1, A[n+1] = 1/n * sum(k=1, n, sumdiv(k, d, d*A[d]) * A[n-k+1] ) ); x*Ser(A)}
    ColSeq(n,k)={my(t=TreeGf(max(0,n+1-k))); my(g(e)=subst(t + O(x*x^(n\e)), x, x^e) + O(x*x^n)); Vec(sumdiv(k, d, eulerphi(d)*g(d)^(k/d))/k + if(k%2, g(1)*g(2)^(k\2), (g(1)^2+g(2))*g(2)^(k/2-1)/2), -n)/2}
    M(n, m=n)={Mat(vector(m, k, ColSeq(n,k)~))}
    { my(T=M(12)); for(n=1, #T~, print(T[n,1..n])) } \\ Andrew Howroyd, Dec 03 2020

Formula

O.g.f. for column k is Z(D[k],A(x)). That is, we substitute for each variable s[i] in the cycle index of the dihedral group of order 2k the series A(x^i), where A(x) is the o.g.f. for A000081.

A368983 Number of connected graphs with loops (symmetric relations) on n unlabeled vertices with n edges.

Original entry on oeis.org

1, 1, 1, 3, 6, 14, 33, 81, 204, 526, 1376, 3648, 9792, 26485, 72233, 198192, 546846, 1515687, 4218564, 11782427, 33013541, 92759384, 261290682, 737688946, 2086993034, 5915398230, 16795618221, 47763406249, 136028420723, 387928330677, 1107692471888, 3166613486137
Offset: 0

Views

Author

Andrew Howroyd, Jan 11 2024

Keywords

Comments

The graphs considered here can have loops but not parallel edges.

Examples

			Representatives of the a(3) = 3 graphs are:
   {{1,2}, {1,3}, {2,3}},
   {{1}, {1,2}, {1,3}},
   {{1}, {1,2}, {2,3}}.
		

Crossrefs

A diagonal of A322114.
The labeled version is A368951.
Cf. A000081, A001429, A027852, A068051, A283755, A368984 (not necessarily connected).

Programs

  • PARI
    \\ TreeGf gives gf of A000081.
    TreeGf(N)={my(A=vector(N, j, 1)); for (n=1, N-1, A[n+1] = 1/n * sum(k=1, n, sumdiv(k, d, d*A[d]) * A[n-k+1] ) ); x*Ser(A)}
    seq(n)={my(t=TreeGf(n)); my(g(e)=subst(t + O(x*x^(n\e)), x, x^e) + O(x*x^n)); Vec(1 + (sum(d=1, n, eulerphi(d)/d*log(1/(1-g(d)))) + ((1+g(1))^2/(1-g(2))-1)/2 - (g(1)^2 + g(2)))/2)}

Formula

a(n) = A000081(n) + A001429(n) = A068051(n) - A027852(n) for n > 0.

A002094 Number of unlabeled connected loop-less graphs on n nodes containing exactly one cycle (of length at least 2) and with all nodes of degree <= 4.

Original entry on oeis.org

0, 1, 2, 5, 10, 25, 56, 139, 338, 852, 2145, 5513, 14196, 36962, 96641, 254279, 671640, 1781840, 4742295, 12662282, 33898923, 90981264, 244720490, 659591378, 1781048728, 4817420360, 13050525328, 35405239155, 96180222540, 261603173201, 712364210543
Offset: 1

Views

Author

Keywords

Comments

A pair of parallel edges is permitted and is regarded as a cycle of length 2.
The original definition in A Handbook of Integer Sequences (1973) based on Schiff (1875) was simply "Alcohols". - N. J. A. Sloane, Mar 22 2018
Schiff used an now outdated terminology and did not use the term "alcohols", but in German "zweiwerthige Kohlenwasserstoffe C_{n}H_{2n} ..." and later "... deren je zwei verfuegbare Affinitaeten ... durch Alkoholradikale befriedigt sind.", translated "bivalent hydrocarbons ... whose free valences ... are covered by alcohol radicals". At that time the meaning of "alcohol radical" was different from modern terminology, now meaning an -OH group, but in Schiff's terminology another C_{x}H{y} hydrocarbon group was meant. The organic compounds that are described by the graphs of this sequence in modern chemical terminology are the acyclic alkenes, with exactly one double carbon-to-carbon bond, and the monocyclic cycloalkanes (see Wikipedia links). - Hugo Pfoertner, Mar 29 2018

References

  • 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).

Crossrefs

Cf. A000294, A000598, A000602, A000625, A000642, A001429 (unbound degrees), A068051.

Programs

  • Maple
    # cycle index of cyclic group C_n
    cycC_n := proc(n::integer,a)
        local d ;
        add(numtheory[phi](d)*a[d]^(n/d),d=numtheory[divisors](n)) ;
        %/n ;
    end proc:
    # cycle index of dihedral group
    cyD_n := proc(n::integer,a)
        cycC_n(n,a)/2 ;
        if type(n,'odd') then
            %+ a[1]*a[2]^((n-1)/2)/2 ;
        else
            %+ ( a[1]^2*a[2]^((n-2)/2) +a[2]^(n/2) )/4 ;
        end if;
    end proc:
    a000642 := [
        1, 1, 2, 3, 7, 14, 32, 72, 171, 405, 989, 2426, 6045, 15167, 38422, 97925,
        251275, 648061, 1679869, 4372872, 11428365, 29972078, 78859809, 208094977,
        550603722, 1460457242, 3882682803, 10344102122, 27612603765, 73844151259,
        197818389539, 530775701520, 1426284383289] ;
    g := [add(a000642[i]*x^i,i=1..nops(a000642)) ];
    for i from 2 to nops(a000642) do
        g := [op(g), subs(x=x^i,g[1]) ] ;
    end do:
    Nmax := nops(a000642) :
    G := 0 ;
    for c from 2 to Nmax do
        f := cyD_n(c,g) ;
        G := G+ taylor(f,x=0,Nmax) ;
    end do:
    taylor(G,x=0,Nmax) ;
    gfun[seriestolist](%) ; # R. J. Mathar, Mar 17 2018
  • Mathematica
    terms = 31;
    cycC[n_, a_] := Sum[EulerPhi[d] a[[d]]^(n/d), {d, Divisors[n]}]/n;
    cyD[n_, a_] := Module[{cc}, cc = (1/2)cycC[n, a]; If[OddQ[n], (1/2)a[[1]]* a[[2]]^((n-1)/2)+cc, (1/4)(a[[1]]^2 a[[2]]^((n-2)/2) + a[[2]]^(n/2)) + cc]];
    B[] = 0; Do[B[x] = Normal[(1/6) x (2 B[x^3] + 3 B[x^2] B[x] + B[x]^3) + O[x]^terms+1], terms];
    A[x_] = (1/2) x (B[x^2] + B[x]^2) + O[x]^(terms+2);
    a000642 = Rest[CoefficientList[A[x], x]];
    g = {Sum[x^i a000642[[i]], {i, 1, terms+1}]};
    For[i = 2, i <= Length[a000642], i++, g = Flatten[Append[g, g[[1]] /. x -> x^i]]];
    For[G = 0; c = 2, c < terms+1, c++, f = cyD[c, g]; G = Series[f, {x, 0, terms+1}] + G];
    Most[Rest[CoefficientList[G, x]]] (* Jean-François Alcover, Mar 26 2020, after R. J. Mathar *)

Formula

Let A(x) denote the generating function for A000598 (Number of rooted ternary trees with n nodes), i.e., A(x) = 1+(1/6)*x*(A(x)^3+3*A(x)*A(x^2)+2*A(x^3)), and set B(x)=(A(x)^2+A(x^2))/2. With D_k(x) being the cycle polynomial of the regular k-gon for k>=2, the final generating function is then given by Sum_{k>=2} x^k*D_k(B(x)), which can be evaluated very quickly. - Sascha Kurz, Mar 18 2018

Extensions

Better definition from R. J. Mathar; terms beyond 852 from R. J. Mathar and Sean A. Irvine, Mar 17 2018
Showing 1-4 of 4 results.