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

A000088 Number of simple graphs on n unlabeled nodes.

Original entry on oeis.org

1, 1, 2, 4, 11, 34, 156, 1044, 12346, 274668, 12005168, 1018997864, 165091172592, 50502031367952, 29054155657235488, 31426485969804308768, 64001015704527557894928, 245935864153532932683719776, 1787577725145611700547878190848, 24637809253125004524383007491432768
Offset: 0

Views

Author

Keywords

Comments

Euler transform of the sequence A001349.
Also, number of equivalence classes of sign patterns of totally nonzero symmetric n X n matrices.

References

  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 430.
  • J. L. Gross and J. Yellen, eds., Handbook of Graph Theory, CRC Press, 2004; p. 519.
  • F. Harary, Graph Theory. Addison-Wesley, Reading, MA, 1969, p. 214.
  • F. Harary and E. M. Palmer, Graphical Enumeration, Academic Press, NY, 1973, p. 240.
  • Thomas Boyer-Kassem, Conor Mayo-Wilson, Scientific Collaboration and Collective Knowledge: New Essays, New York, Oxford University Press, 2018, see page 47.
  • M. Kauers and P. Paule, The Concrete Tetrahedron, Springer 2011, p. 54.
  • Lupanov, O. B. Asymptotic estimates of the number of graphs with n edges. (Russian) Dokl. Akad. Nauk SSSR 126 1959 498--500. MR0109796 (22 #681).
  • M. D. McIlroy, Calculation of numbers of structures of relations on finite sets, Massachusetts Institute of Technology, Research Laboratory of Electronics, Quarterly Progress Reports, No. 17, Sep. 15, 1955, pp. 14-22.
  • R. C. Read and R. J. Wilson, An Atlas of Graphs, Oxford, 1998.
  • R. W. Robinson, Numerical implementation of graph counting algorithms, AGRC Grant, Math. Dept., Univ. Newcastle, Australia, 1976.
  • 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

Partial sums of A002494.
Cf. A000666 (graphs with loops), A001349 (connected graphs), A002218, A006290, A003083.
Column k=1 of A063841.
Column k=2 of A309858.
Row sums of A008406.
Cf. also A000055, A000664.
Partial sums are A006897.

Programs

  • Maple
    # To produce all graphs on 4 nodes, for example:
    with(GraphTheory):
    L:=[NonIsomorphicGraphs](4,output=graphs,outputform=adjacency): # N. J. A. Sloane, Oct 07 2013
    seq(GraphTheory[NonIsomorphicGraphs](n,output=count),n=1..10); # Juergen Will, Jan 02 2018
    # alternative Maple program:
    b:= proc(n, i, l) `if`(n=0 or i=1, 1/n!*2^((p-> add(ceil((p[j]-1)/2)
          +add(igcd(p[k], p[j]), k=1..j-1), j=1..nops(p)))([l[], 1$n])),
           add(b(n-i*j, i-1, [l[], i$j])/j!/i^j, j=0..n/i))
        end:
    a:= n-> b(n$2, []):
    seq(a(n), n=0..20);  # Alois P. Heinz, Aug 14 2019
  • Mathematica
    Needs["Combinatorica`"]
    Table[NumberOfGraphs[n], {n, 0, 19}] (* Geoffrey Critzer, Mar 12 2011 *)
    permcount[v_] := Module[{m = 1, s = 0, k = 0, t}, For[i = 1, i <= Length[v], i++, t = v[[i]]; k = If[i > 1 && t == v[[i - 1]], k + 1, 1]; m *= t*k; s += t]; s!/m];
    edges[v_] := Sum[GCD[v[[i]], v[[j]]], {i, 2, Length[v]}, {j, 1, i - 1}] + Total[Quotient[v, 2]];
    a[n_] := Module[{s = 0}, Do[s += permcount[p]*2^edges[p], {p, IntegerPartitions[n]}]; s/n!];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Jul 05 2018, after Andrew Howroyd *)
    b[n_, i_, l_] := If[n==0 || i==1, 1/n!*2^(Function[p, Sum[Ceiling[(p[[j]]-1 )/2]+Sum[GCD[p[[k]], p[[j]]], {k, 1, j-1}], {j, 1, Length[p]}]][Join[l, Table[1, {n}]]]), Sum[b[n-i*j, i-1, Join[l, Table[i, {j}]]]/j!/i^j, {j, 0, n/i}]];
    a[n_] := b[n, n, {}];
    a /@ Range[0, 20] (* Jean-François Alcover, Dec 03 2019, after Alois P. Heinz *)
  • PARI
    permcount(v) = {my(m=1,s=0,k=0,t); for(i=1,#v,t=v[i]; k=if(i>1&&t==v[i-1],k+1,1); m*=t*k;s+=t); s!/m}
    edges(v) = {sum(i=2, #v, sum(j=1, i-1, gcd(v[i],v[j]))) + sum(i=1, #v, v[i]\2)}
    a(n) = {my(s=0); forpart(p=n, s+=permcount(p)*2^edges(p)); s/n!} \\ Andrew Howroyd, Oct 22 2017
    
  • Python
    from itertools import combinations
    from math import prod, factorial, gcd
    from fractions import Fraction
    from sympy.utilities.iterables import partitions
    def A000088(n): return int(sum(Fraction(1<>1)*r+(q*r*(r-1)>>1) for q, r in p.items()),prod(q**r*factorial(r) for q, r in p.items())) for p in partitions(n))) # Chai Wah Wu, Jul 02 2024
  • Sage
    def a(n):
        return len(list(graphs(n)))
    # Ralf Stephan, May 30 2014
    

Formula

a(n) = 2^binomial(n, 2)/n!*(1+(n^2-n)/2^(n-1)+8*n!/(n-4)!*(3*n-7)*(3*n-9)/2^(2*n)+O(n^5/2^(5*n/2))) (see Harary, Palmer reference). - Vladeta Jovovic and Benoit Cloitre, Feb 01 2003
a(n) = 2^binomial(n, 2)/n!*[1+2*n$2*2^{-n}+8/3*n$3*(3n-7)*2^{-2n}+64/3*n$4*(4n^2-34n+75)*2^{-3n}+O(n^8*2^{-4*n})] where n$k is the falling factorial: n$k = n(n-1)(n-2)...(n-k+1). - Keith Briggs, Oct 24 2005
From David Pasino (davepasino(AT)yahoo.com), Jan 31 2009: (Start)
a(n) = a(n, 2), where a(n, t) is the number of t-uniform hypergraphs on n unlabeled nodes (cf. A000665 for t = 3 and A051240 for t = 4).
a(n, t) = Sum_{c : 1*c_1+2*c_2+...+n*c_n=n} per(c)*2^f(c), where:
..per(c) = 1/(Product_{i=1..n} c_i!*i^c_i);
..f(c) = (1/ord(c)) * Sum_{r=1..ord(c)} Sum_{x : 1*x_1+2*x_2+...+t*x_t=t} Product_{k=1..t} binomial(y(r, k; c), x_k);
..ord(c) = lcm{i : c_i>0};
..y(r, k; c) = Sum_{s|r : gcd(k, r/s)=1} s*c_(k*s) is the number of k-cycles of the r-th power of a permutation of type c. (End)
a(n) ~ 2^binomial(n,2)/n! [see Flajolet and Sedgewick p. 106, Gross and Yellen, p. 519, etc.]. - N. J. A. Sloane, Nov 11 2013
For asymptotics see also Lupanov 1959, 1960, also Turner and Kautz, p. 18. - N. J. A. Sloane, Apr 08 2014
a(n) = G(1) where G(z) = (1/n!) Sum_g det(I-g z^2)/det(I-g z) and g runs through the natural matrix n X n representation of the pair group A^2_n (for A^2_n see F. Harary and E. M. Palmer, Graphical Enumeration, page 83). - Leonid Bedratyuk, May 02 2015
From Keith Briggs, Jun 24 2016: (Start)
a(n) = 2^binomial(n,2)/n!*(
1+
2^( -n + 1)*n$2+
2^(-2*n + 3)*n$3*(n-7/3)+
2^(-3*n + 6)*n$4*(4*n^2/3 - 34*n/3 + 25) +
2^(-4*n + 10)*n$5*(8*n^3/3 - 142*n^2/3 + 2528*n/9 - 24914/45) +
2^(-5*n + 15)*n$6*(128*n^4/15 - 2296*n^3/9 + 25604*n^2/9 - 630554*n/45 + 25704) +
2^(-6*n + 21)*n$7*(2048*n^5/45 - 18416*n^4/9 + 329288*n^3/9 - 131680816*n^2/405 + 193822388*n/135 - 7143499196/2835) + ...),
where n$k is the falling factorial: n$k = n(n-1)(n-2)...(n-k+1), using the method of Wright 1969.
(End)
a(n) = 1/n*Sum_{k=1..n} a(n-k)*A003083(k). - Andrey Zabolotskiy, Aug 11 2020

Extensions

Harary gives an incorrect value for a(8); compare A007149

A006896 a(n) is the number of hierarchical linear models on n labeled factors allowing 2-way interactions (but no higher order interactions); or the number of simple labeled graphs with nodes chosen from an n-set.

Original entry on oeis.org

1, 2, 5, 18, 113, 1450, 40069, 2350602, 286192513, 71213783666, 35883905263781, 36419649682706466, 74221659280476136241, 303193505953871645562970, 2480118046704094643352358501, 40601989176407026666590990422106, 1329877330167226219547875498464516481
Offset: 0

Views

Author

Keywords

Comments

From Petros Hadjicostas, Apr 09 2020: (Start)
Hierarchical log-linear models are by definition nonempty because they always include an "intercept" (or "overall effect").
Note that this is different from the number of graphical hierarchical log-linear models on n labeled factors as defined in the referenced Wikipedia article about log-linear models, "A log-linear model is graphical if, whenever the model contains all two-factor terms generated by a higher-order interaction, the model also contains the higher-order interaction." See also Gauraha (2016). (End) (Comment revised by N. J. A. Sloane, Apr 23 2020.)

Examples

			From _Petros Hadjicostas_, Apr 09 2020: (Start)
For n = 2, consider the pair of nodes {X, Y}. The simple labeled graphs with nodes from this set are the empty graph G1 = [], G2 = [X], G3 = [Y], G4 = [X, Y], and G5 = [X, Y, X-Y]. Thus a(2) = 5.
For n = 3, consider the three nodes {X, Y, Z}. The simple labeled graphs with nodes from this set are G1 = [], G2 = [X], G3 = [Y], G4 = [Z], G5 = [X, Y], G6 = [X, Z], G7 = [Y, Z], G8 = [X, Y, X-Y], G9 = [X, Z, X-Z], G10 = [Y, Z, Y-Z], G11 = [X, Y, Z], G12 = [X-Y Z], G13 = [X, Y,Z, X-Z], G14 = [X, Y, Z, Y-Z ], G15 = [X, Y, Z, Y-X-Z], G16 = [X, Y, Z, X-Y-Z], G17 = [Z, Y, Z, X-Z-Y], and G18 = [X, Y, Z, triangle with nodes X, Y, Z]. Thus a(3) = 18.
In Wickramasinghe (2008), for n = 2, all A014466(2) = 5 hierarchical log-linear models on two factors X and Y, which appear on p. 18, are trivially graphical; thus a(2) = 5.
For n = 3, among the A014466(3) = 19 hierarchical log-linear models on three factors X, Y, and Z, which appear on p. 36, only Model 18 is not graphical because it contains the X-Y, Y-Z, and Z-X interactions but does not contain the 3-way X-Y-Z interaction; thus a(3) = 19 - 1 = 18. (End)
		

References

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

Crossrefs

Cf. A004140, A006897 (unlabeled case).

Programs

  • Maple
    A006896 := proc(n) local k; 1+binomial(n,1) +add(binomial(n,k)*2^(1/2*k*(k-1)), k = 2 .. n) end; seq (A006896(n), n=0..20);
  • Mathematica
    nn=20;g=Sum[2^Binomial[n,2]x^n/n!,{n,0,nn}];Range[0,nn]! CoefficientList[Series[Exp[x]g,{x,0,nn}],x]  (* Geoffrey Critzer, Apr 11 2012 *)
  • PARI
    a(n)=sum(k=0,n,binomial(n,k)*2^((k^2-k)/2))

Formula

a(n) = 1 + C(n, 1) + C(n, 2)*2 + C(n, 3)*2^3 + C(n, 4)*2^6 + ... + C(n, n)*2^(n*(n-1)/2).
a(n) = 1 + A004140(n).
E.g.f.: exp(x)*A(x) where A(x) is e.g.f. for A006125. - Geoffrey Critzer, Apr 11 2012.

Extensions

Error in formula line corrected Sep 15 1997 (thanks to R. K. Guy for pointing this out)
Name expanded by Petros Hadjicostas, Apr 08 2020
Edited by N. J. A. Sloane, Apr 23 2020

A371161 Maximum number of unlabeled graphs with at most n nodes such that neither one is a subgraph of another.

Original entry on oeis.org

1, 1, 1, 2, 3, 7, 26, 157, 1687
Offset: 0

Views

Author

Max Alekseyev, Mar 13 2024

Keywords

Comments

Width of the poset of unlabeled graphs of order at most n with the subgraph relationship.
a(n) >= A000717(n).

Crossrefs

A006898 a(n) = Sum_{k=0..n} C(n,k)*2^(k*(k+1)/2).

Original entry on oeis.org

1, 3, 13, 95, 1337, 38619, 2310533, 283841911, 70927591153, 35812691480115, 36383765777442685, 74185239630793429775, 303119284294591169426729, 2479814853198140771706795531, 40599509058360322571947638063605
Offset: 0

Views

Author

Keywords

Comments

First differences of A006896.

References

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

Crossrefs

Programs

  • Mathematica
    Table[Sum[Binomial[n,k]2^((k(k+1))/2),{k,0,n}],{n,0,20}] (* Harvey P. Dale, Apr 01 2023 *)
  • PARI
    a(n)=sum(k=0,n,binomial(n,k)*2^(k*(k+1)/2)) \\ Paul D. Hanna, Apr 10 2009

Formula

a(n) ~ 2^(n*(n+1)/2). - Vaclav Kotesovec, Nov 27 2017

Extensions

Formula and more terms from Vladeta Jovovic, Sep 20 2003
Edited by N. J. A. Sloane, Apr 12 2009 at the suggestion of Vladeta Jovovic

A376782 Triangle read by rows: T(n,m) is the number of unlabeled graphs with n vertices having m minimum forbidden subgraphs, n >= 1, 1 <= m <= A371162(n).

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 4, 4, 2, 1, 4, 8, 13, 8, 1, 4, 5, 7, 20, 34, 31, 28, 12, 8, 5, 0, 1, 1, 4, 5, 13, 26, 33, 43, 59, 50, 62, 58, 60, 64, 67, 63, 70, 68, 65, 61, 60, 31, 28, 16, 8, 13, 4, 4, 4, 0, 2, 1, 0, 1, 1, 4, 6, 9, 21, 34, 39, 71, 74, 77, 99, 118, 124, 107, 129
Offset: 1

Views

Author

Max Alekseyev, Oct 03 2024

Keywords

Examples

			Triangle starts with
n = 1: 1
n = 2: 1 1
n = 3: 1 3
n = 4: 1 4 4  2
n = 5: 1 4 8 13  8
n = 6: 1 4 5  7 20 34 31 28 12 8 5 0 1
...
		

Crossrefs

Cf. A000088 (row sums), A371162 (row lengths), A000012 (column m=1), A113311 (column m=2).

A353213 Number of simple unlabeled non-null graphs on <= n nodes.

Original entry on oeis.org

1, 3, 7, 18, 52, 208, 1252, 13598, 288266, 12293434, 1031291298, 166122463890, 50668153831842, 29104823811067330, 31455590793615376098, 64032471295321173271026, 245999896624828253856990802, 1787823725042236528801735181650, 24639597076850046760911809226614418, 645514762392876691902925550299969363858
Offset: 1

Views

Author

Eric W. Weisstein, Apr 30 2022

Keywords

Comments

Also the number of (non-null) graph minors of the complete graph K_n.

Crossrefs

Cf. A000088 (number of simple graphs on n nodes).
Cf. A006897 (number of simple graphs on 0 to n nodes).

Formula

a(n) = A006897(n) - 1.
a(n) = Sum_{k=1..n} A000088(k).

A376780 Triangular table read by rows: T(n,k) is the minimum number of minimal forbidden subgraphs of a graph with n vertices and k edges, n >= 1, 0 <= k <= n*(n-1)/2.

Original entry on oeis.org

1, 2, 1, 2, 2, 2, 1, 2, 3, 2, 3, 2, 2, 1, 2, 3, 2, 3, 3, 4, 3, 3, 2, 2, 1, 2, 3, 3, 2, 4, 3, 4, 5, 5, 4, 5, 5, 4, 2, 2, 1, 2, 3, 3, 2, 4, 4, 3, 4, 5, 4, 5, 5, 7, 6, 6, 5, 5, 4, 4, 2, 2, 1, 2, 3, 3, 3, 2, 4, 4, 3, 5, 6, 5, 6, 5, 5, 7, 6, 7, 10, 9, 9, 9, 8, 10, 5, 5, 4, 2, 2, 1
Offset: 1

Views

Author

Max Alekseyev, Oct 03 2024

Keywords

Examples

			Table starts with
n = 1: 1
n = 2: 2, 1
n = 3: 2, 2, 2, 1
n = 4: 2, 3, 2, 3, 2, 2, 1
...
		

Crossrefs

A376781 Triangular table read by rows: T(n,k) is the maximum number of minimal forbidden subgraphs of a graph with n vertices and k edges, n >= 1, 0 <= k <= n*(n-1)/2.

Original entry on oeis.org

1, 2, 1, 2, 2, 2, 1, 2, 3, 4, 4, 3, 2, 1, 2, 3, 4, 5, 5, 5, 5, 4, 3, 2, 1, 2, 3, 4, 6, 8, 8, 9, 13, 11, 11, 9, 6, 5, 3, 2, 1, 2, 3, 4, 6, 8, 8, 11, 16, 20, 23, 28, 31, 30, 33, 24, 22, 15, 10, 7, 3, 2, 1, 2, 3, 4, 6, 8, 9, 14, 21, 24, 31, 41, 57, 78, 86, 106, 123, 134, 149, 143, 138, 133, 75, 46, 37, 18, 11, 3, 2, 1
Offset: 1

Views

Author

Max Alekseyev, Oct 03 2024

Keywords

Examples

			Table starts with
n = 1: 1
n = 2: 2, 1
n = 3: 2, 2, 2, 1
n = 4: 2, 3, 4, 4, 3, 2, 1
...
		

Crossrefs

Cf. A371162 (row maximums).

A217653 Triangular array read by rows: T(n,k) is the number of unlabeled simple graphs with n nodes that have exactly k isolated nodes, (n>=0, 0<=k<=n).

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 7, 2, 1, 0, 1, 23, 7, 2, 1, 0, 1, 122, 23, 7, 2, 1, 0, 1, 888, 122, 23, 7, 2, 1, 0, 1, 11302, 888, 122, 23, 7, 2, 1, 0, 1, 262322, 11302, 888, 122, 23, 7, 2, 1, 0, 1, 11730500, 262322, 11302, 888, 122, 23, 7, 2, 1, 0, 1
Offset: 0

Views

Author

Geoffrey Critzer, Oct 09 2012

Keywords

Comments

Row sums = A000088.
Sum_{k=1..n} T(n,k)*k = A006897(n).
Column k = 0 is A002494.

Examples

			1,
0, 1,
1, 0, 1,
2, 1, 0, 1,
7, 2, 1, 0, 1,
23, 7, 2, 1, 0, 1,
122, 23, 7, 2, 1, 0, 1
		

Crossrefs

Programs

  • Mathematica
    Needs["Combinatorica`"]; nn=10; s=Sum[NumberOfGraphs[n]x^n, {n,0,nn}]; CoefficientList[Series[s (1-x)/(1-y x), {x,0,nn}], {x,y}] //Grid

Formula

O.g.f.: A(x)/(1-y*x) where A(x) is o.g.f. for A002494.

A386399 Number of forests with at most n unlabeled nodes.

Original entry on oeis.org

1, 2, 4, 7, 13, 23, 43, 80, 156, 309, 638, 1348, 2949, 6607, 15206, 35720, 85625, 208588, 515787, 1291316, 3269194, 8355832, 21539988, 55942920, 146271594, 384746580, 1017522228, 2704227858, 7219183490, 19351410860, 52068524665, 140588391713, 380824067016
Offset: 0

Views

Author

Max Alekseyev, Jul 20 2025

Keywords

Crossrefs

Formula

G.f.: exp(sum_{k>0} B(x^k)/k ) / (1-x), where B(x) = x + x^2 + x^3 + 2*x^4 + 3*x^5 + 6*x^6 + 11*x^7 + ... = C(x)-1 and C is the g.f. for A000055.
Showing 1-10 of 11 results. Next