A058882 Erroneous version of A000665.
1, 1, 2, 5, 34, 2136, 7013488
Offset: 1
Keywords
References
- F. Harary and E. M. Palmer, Graphical Enumeration, Academic Press, NY, 1973, p. 231.
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.
# 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
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 *)
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
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
def a(n): return len(list(graphs(n))) # Ralf Stephan, May 30 2014
Square array A(n,k) begins: 2, 1, 1, 1, 1, 1, 1, 1, ... 2, 2, 1, 1, 1, 1, 1, 1, ... 2, 3, 2, 1, 1, 1, 1, 1, ... 2, 4, 4, 2, 1, 1, 1, 1, ... 2, 5, 11, 5, 2, 1, 1, 1, ... 2, 6, 34, 34, 6, 2, 1, 1, ... 2, 7, 156, 2136, 156, 7, 2, 1, ... 2, 8, 1044, 7013320, 7013320, 1044, 8, 2, ...
g:= (l, i, n)-> `if`(i=0, `if`(n=0, [[]], []), [seq(map(x-> [x[], j], g(l, i-1, n-j))[], j=0..min(l[i], n))]): h:= (p, v)-> (q-> add((s-> add(`if`(andmap(i-> irem(k[i], p[i] /igcd(t, p[i]))=0, [$1..q]), mul((m-> binomial(m, k[i]*m /p[i]))(igcd(t, p[i])), i=1..q), 0), t=1..s)/s)(ilcm(seq( `if`(k[i]=0, 1, p[i]), i=1..q))), k=g(p, q, v)))(nops(p)): b:= (n, i, l, v)-> `if`(n=0 or i=1, 2^((p-> h(p, v))([l[], 1$n])) /n!, add(b(n-i*j, i-1, [l[], i$j], v)/j!/i^j, j=0..n/i)): A:= proc(n, k) option remember; `if`(k>n, 1, `if`(k>n-k, A(n, n-k), b(n$2, [], k))) end: seq(seq(A(n, d-n), n=0..d), d=0..12);
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} rep(typ)={my(L=List(), k=0); for(i=1, #typ, k+=typ[i]; listput(L, k); while(#L0, u=vecsort(apply(f, u)); d=lex(u, v)); !d} Q(n, k, perm)={my(t=0); forsubset([n, k], v, t += can(Vec(v), t->perm[t])); t} T(n, k)={my(s=0); forpart(p=n, s += permcount(p)*2^Q(n, k, rep(p))); s/n!} \\ Andrew Howroyd, Aug 22 2019
Non-isomorphic representatives of the a(5) = 29 hypergraphs: {{125}{345}} {{123}{245}{345}} {{135}{245}{345}} {{145}{245}{345}} {{123}{145}{245}{345}} {{124}{135}{245}{345}} {{125}{135}{245}{345}} {{134}{235}{245}{345}} {{145}{235}{245}{345}} {{123}{124}{135}{245}{345}} {{123}{145}{235}{245}{345}} {{124}{134}{235}{245}{345}} {{134}{145}{235}{245}{345}} {{135}{145}{235}{245}{345}} {{145}{234}{235}{245}{345}} {{123}{124}{134}{235}{245}{345}} {{123}{134}{145}{235}{245}{345}} {{123}{145}{234}{235}{245}{345}} {{124}{135}{145}{235}{245}{345}} {{125}{135}{145}{235}{245}{345}} {{135}{145}{234}{235}{245}{345}} {{123}{124}{135}{145}{235}{245}{345}} {{124}{135}{145}{234}{235}{245}{345}} {{125}{135}{145}{234}{235}{245}{345}} {{134}{135}{145}{234}{235}{245}{345}} {{123}{124}{135}{145}{234}{235}{245}{345}} {{125}{134}{135}{145}{234}{235}{245}{345}} {{124}{125}{134}{135}{145}{234}{235}{245}{345}} {{123}{124}{125}{134}{135}{145}{234}{235}{245}{345}}
a(3) = 5!! * 7^2 = (1*3*5) * 49 = 735. From _Gus Wiseman_, Jan 12 2019: (Start) The a(2) = 15 3-uniform hypertrees: {{1,2,3},{1,4,5}} {{1,2,3},{2,4,5}} {{1,2,3},{3,4,5}} {{1,2,4},{1,3,5}} {{1,2,4},{2,3,5}} {{1,2,4},{3,4,5}} {{1,2,5},{1,3,4}} {{1,2,5},{2,3,4}} {{1,2,5},{3,4,5}} {{1,3,4},{2,3,5}} {{1,3,4},{2,4,5}} {{1,3,5},{2,3,4}} {{1,3,5},{2,4,5}} {{1,4,5},{2,3,4}} {{1,4,5},{2,3,5}} The following are non-isomorphic representatives of the 2 unlabeled 3-uniform hypertrees spanning 7 vertices, and their multiplicities in the labeled case, which add up to a(3) = 735: 105 X {{1,2,7},{3,4,7},{5,6,7}} 630 X {{1,2,6},{3,4,7},{5,6,7}} (End)
[(2*n+1)^(n-1)*Factorial(2*n)/(2^n*Factorial(n)): n in [0..15]]; // Vincenzo Librandi, Feb 19 2020
Table[(2n+1)^(n-1)(2n)!/(2^n n!), {n, 0, 14}] (* Jean-François Alcover, Nov 06 2018 *)
Table[(2^(n - 2) - n + 1) Binomial[n, 2] + Binomial[n, 3] + 5 Binomial[n, 4] + 1, {n, 20}] (* Eric W. Weisstein, Jul 21 2017 *) LinearRecurrence[{11, -52, 138, -225, 231, -146, 52, -8}, {1, 1, 2, 16, 76, 261, 757, 2003}, 20] (* Eric W. Weisstein, Jul 21 2017 *) CoefficientList[Series[(1 - 10 x + 43 x^2 - 92 x^3 + 91 x^4 - 25 x^5 - 5 x^6 - 8 x^7)/((-1 + x)^5 (-1 + 2 x)^3), {x, 0, 20}], x] (* Eric W. Weisstein, Jul 21 2017 *) stableSets[u_,Q_]:=If[Length[u]===0,{{}},With[{w=First[u]},Join[stableSets[DeleteCases[u,w],Q],Prepend[#,w]&/@stableSets[DeleteCases[u,r_/;r===w||Q[r,w]||Q[w,r]],Q]]]]; Table[Length[stableSets[Subsets[Range[n],{3}],Length[Intersection[#1,#2]]<=1&]],{n,6}] (* Gus Wiseman, Jan 11 2019 *)
a(n) = 1 + binomial(n,3) + (2^(n-2)-n+1)*binomial(n,2) + 5*binomial(n,4); \\ Andrew Howroyd, Jul 18 2017
Vec(x*(1 - 10*x + 43*x^2 - 92*x^3 + 91*x^4 - 25*x^5 - 5*x^6 - 8*x^7) / ((1 - x)^5*(1 - 2*x)^3) + O(x^40)) \\ Colin Barker, Jul 19 2017
Non-isomorphic representatives of the a(2) = 10 multiset systems: {} {{111}} {{122}} {{111}{222}} {{112}{122}} {{112}{222}} {{122}{222}} {{111}{122}{222}} {{112}{122}{222}} {{111}{112}{122}{222}}
Table[Sum[2^PermutationCycles[Ordering[Map[Sort,Select[Tuples[Range[n],3],OrderedQ]/.Rule@@@Table[{i,prm[[i]]},{i,n}],{1}]],Length],{prm,Permutations[Range[n]]}]/n!,{n,6}]
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} rep(typ)={my(L=List(), k=0); for(i=1, #typ, k+=typ[i]; listput(L, k); while(#L0, u=vecsort(apply(f, u)); d=lex(u, v)); !d} Q(perm)={my(t=0); forsubset([#perm+2, 3], v, t += can([v[1],v[2]-1,v[3]-2], t->perm[t])); t} a(n)={my(s=0); forpart(p=n, s += permcount(p)*2^Q(rep(p))); s/n!} \\ Andrew Howroyd, Aug 26 2019
The a(5) = 26 hypergraphs: {} {{1,2,3}} {{1,2,4}} {{1,2,5}} {{1,3,4}} {{1,3,5}} {{1,4,5}} {{2,3,4}} {{2,3,5}} {{2,4,5}} {{3,4,5}} {{1,2,3},{1,4,5}} {{1,2,3},{2,4,5}} {{1,2,3},{3,4,5}} {{1,2,4},{1,3,5}} {{1,2,4},{2,3,5}} {{1,2,4},{3,4,5}} {{1,2,5},{1,3,4}} {{1,2,5},{2,3,4}} {{1,2,5},{3,4,5}} {{1,3,4},{2,3,5}} {{1,3,4},{2,4,5}} {{1,3,5},{2,3,4}} {{1,3,5},{2,4,5}} {{1,4,5},{2,3,4}} {{1,4,5},{2,3,5}} Non-isomorphic representatives of the 6 unlabeled 3-uniform hypertrees spanning 6 vertices where no two edges have two vertices in common, and their multiplicities in the labeled case which add up to a(6) = 271: 1 X {} 20 X {{1,2,3}} 90 X {{1,2,5},{3,4,5}} 10 X {{1,2,3},{4,5,6}} 120 X {{1,3,5},{2,3,6},{4,5,6}} 30 X {{1,2,4},{1,3,5},{2,3,6},{4,5,6}}
stableSets[u_,Q_]:=If[Length[u]===0,{{}},With[{w=First[u]},Join[stableSets[DeleteCases[u,w],Q],Prepend[#,w]&/@stableSets[DeleteCases[u,r_/;r===w||Q[r,w]||Q[w,r]],Q]]]]; Table[Length[stableSets[Subsets[Range[n],{3}],Length[Intersection[#1,#2]]>1&]],{n,8}]
Comments