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

A007869 Number of complementary pairs of graphs on n nodes. Also number of unlabeled graphs with n nodes and an even number of edges.

Original entry on oeis.org

1, 1, 2, 6, 18, 78, 522, 6178, 137352, 6002584, 509498932, 82545586656, 25251015686776, 14527077828617744, 15713242984902154384, 32000507852263779299344, 122967932076766466347469888, 893788862572805850273939095424, 12318904626562502262191503745716384
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A054960 for graphs with an odd number of edges.

Programs

  • Mathematica
    Needs["Combinatorica`"]; Table[Total[Table[NumberOfGraphs[n,m],{m,0,Binomial[n,2],2}]],{n,1,15}]  (* Geoffrey Critzer, Oct 20 2012; modified by Harvey P. Dale, Aug 08 2013 *)
  • PARI
    a(n)={local(p=vector(n));
    my(S=0, J() = sum(j=0, floor((n-1)/2), p[2*j+1]),
        I2() = (sum(i=1, n, sum(j=1, n, p[i]*p[j]*gcd(i, j))) - J())/2,
        M1() = (abs((p[1]-0)*(p[1]-1)) + sum(j=2, n, if(0!=(j%4), p[j], 0))),
    inc()=!forstep(i=n, 1, -1, p[i]n, p[i]=n); next(2))); t==n && S+=(if(M1() == 0, 2^I2()/prod(i=1, n, i^p[i]*p[i]!), 0) + 2^I2()/prod(i=1, n, i^p[i]*p[i]!))/2); S} \\ This is a modification of M. F. Hasler's PARI program from A002854. - Petros Hadjicostas, Mar 02 2021

Formula

Average of A000088 and A000171.

Extensions

More terms from Vladeta Jovovic, Jul 19 2000
Terms a(18) and beyond from Andrew Howroyd, Sep 17 2018

A003086 Number of self-complementary digraphs with n nodes.

Original entry on oeis.org

1, 1, 4, 10, 136, 720, 44224, 703760, 179228736, 9168331776, 9383939974144, 1601371799340544, 6558936236286040064, 3837878966366932639744, 62879572771326489528942592, 128777257564337108286016980992
Offset: 1

Views

Author

Keywords

References

  • F. Harary and E. M. Palmer, Graphical Enumeration, Academic Press, NY, 1973, pp. 140, 243.
  • R. C. Read and R. J. Wilson, An Atlas of Graphs, Oxford, 1998.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    Table[GraphPolynomial[n,x,Directed]/.x -> -1,{n,1,20}]  (* Geoffrey Critzer, Oct 21 2012 *)
    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_] := 4 Sum[Sum[GCD[v[[i]], v[[j]]], {j, 1, i - 1}], {i, 2, Length[v]}] + Sum[2 v[[i]] - 1, {i, 1, Length[v]}];
    a[n_] := (s = 0; Do[s += permcount[2 p]*2^edges[p]*If[OddQ[n], n *4^Length[p], 1], {p, IntegerPartitions[n/2 // Floor]}]; s/n!);
    Array[a, 16] (* Jean-François Alcover, Aug 26 2019, after Andrew Howroyd *)
  • 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) = {4*sum(i=2, #v, sum(j=1, i-1, gcd(v[i],v[j]))) + sum(i=1, #v, 2*v[i]-1)}
    a(n) = {my(s=0); forpart(p=n\2, s+=permcount(2*Vec(p))*2^edges(p)*if(n%2, n*4^#p, 1)); s/n!} \\ Andrew Howroyd, Sep 16 2018

Extensions

More terms from Ronald C. Read and Vladeta Jovovic.

A054960 Number of unlabeled graphs with n nodes and an odd number of edges.

Original entry on oeis.org

0, 1, 2, 5, 16, 78, 522, 6168, 137316, 6002584, 509498932, 82545585936, 25251015681176, 14527077828617744, 15713242984902154384, 32000507852263778595584, 122967932076766466336249888, 893788862572805850273939095424, 12318904626562502262191503745716384
Offset: 1

Views

Author

N. J. A. Sloane, May 24 2000

Keywords

Crossrefs

Cf. A007869 for graphs with an even number of edges.

Programs

  • Mathematica
    Table[Total[Table[NumberOfGraphs[n,m],{m,1,Binomial[n,2],2}]],{n,1,15}]  (* Geoffrey Critzer, Oct 20 2012 *)

Formula

a(n) = (A000088(n) - A000171(n))/2.

Extensions

More terms from Vladeta Jovovic, Jul 19 2000
Terms a(18) and beyond from Andrew Howroyd, Sep 17 2018

A047832 Number of self-complementary binary relations on a 2n-element set.

Original entry on oeis.org

2, 36, 5600, 11220000, 293293716992, 102484848265030656, 491247277315343649710080, 32966971058719932671168222859264, 31464896751148469761776612436741418123264, 432450241375084625203842385525712986695638650716160
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A000171.

Programs

  • Mathematica
    Needs["Combinatorica`"]; Table[ Print[an = GraphPolynomial[4*n + 1, x] /. x -> -1]; an, {n, 1, 9}] (* Jean-François Alcover, Aug 12 2013 *)

Formula

a(n) = A000171(4*n+1).

Extensions

Terms a(10) and beyond from Andrew Howroyd, Sep 17 2018

A002785 Number of self-complementary oriented graphs with n nodes.

Original entry on oeis.org

1, 1, 2, 2, 8, 12, 88, 176, 2752, 8784, 279968, 1492288, 95458560, 872687552, 111698291584, 1787154671104, 457509297625088, 13013584213369088, 6662951988432581120, 341143107490935724032, 349330527429800077778944, 32519496073514216703585280
Offset: 1

Views

Author

Keywords

Comments

Also, self-converse tournaments. - Brendan McKay, Dec 31 2020
Farrugia's Chapter 8 on enumeration of self-complementary and self-converse graphs and digraphs contains many explicit formulas as well as an in-depth discussion of the literature on this subject. - Pab Ter (pabrlos2(AT)yahoo.com), Oct 22 2005

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

Programs

  • Maple
    with(combinat, partition): j:=proc(p) local k, jpart: jpart:=[seq(0,k=1..max(op(p)))]: for k from 1 to nops(p) do jpart[p[k]]:=jpart[p[k]]+1 od: RETURN(jpart): end; numeven:=jtot->2^add(add((2*igcd(r,t)*jtot[r]*jtot[t]),r=1..t-1)+(t*jtot[t]^2-jtot[t]),t=1..nops(jtot)); numodd:=jtot->mul(mul(2^(igcd(r,t)*jtot[r]*jtot[t]),r=1..nops(jtot)),t=1..nops(jtot));den:=jtot->mul(k^jtot[k]*jtot[k]!,k=1..nops(jtot)); testj:=proc(jtot) local i: for i from 1 to floor(nops(jtot)/2) do if(jtot[2*i]<>0) then RETURN(0) fi od: RETURN(1) end; teven:=proc(n) local s,part,k,p,jtot: s:=0: part:=partition(n): for k from 1 to nops(part) do p:=part[k]: jtot:=j(p): if testj(jtot)=1 then s:=s+numeven(jtot)/den(jtot) fi od:RETURN(s): end; todd:=proc(n) local s,part,k,p,jtot: s:=0: part:=partition(n): for k from 1 to nops(part) do p:=part[k]: jtot:=j(p): if testj(jtot)=1 then s:=s+numodd(jtot)/den(jtot) fi od:RETURN(s): end; seq(op([todd(n),teven(n+1)]),n=1..12); (Pab Ter)
  • Mathematica
    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_] := 2*Sum[Sum[GCD[v[[i]], v[[j]]], {j, 1, i-1}], {i, 2, Length[v]}]+Total[v];
    oddp[v_] := Module[{i}, For[i = 1, i <= Length[v], i++, If[BitAnd[v[[i]], 1] == 0, Return[0]]]; 1];
    a[n_] := Module[{s = 0}, Do[If[oddp[p] == 1, s += permcount[2*p]*2^edges[p]*If[OddQ[n], n*2^Length[p], 1]], {p, IntegerPartitions[Quotient[n, 2]]}]; s/n!];
    Array[a, 22] (* Jean-François Alcover, Jan 07 2021, after Andrew Howroyd *)
  • 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) = {2*sum(i=2, #v, sum(j=1, i-1, gcd(v[i],v[j]))) + sum(i=1, #v, v[i])}
    oddp(v) = {for(i=1, #v, if(bitand(v[i], 1)==0, return(0))); 1}
    a(n) = {my(s=0); forpart(p=n\2, if(oddp(p), s+=permcount(2*Vec(p)) * 2^edges(p) * if(n%2, n*2^#p, 1))); s/n!} \\ Andrew Howroyd, Sep 16 2018

Formula

a(2*n) = Sum_{j partition of n & jk=0 if k even} [ Product_{k} 2^(k*jk^2-jk) * Product_{r

Extensions

More terms from Pab Ter (pabrlos2(AT)yahoo.com), Oct 22 2005
a(1)-a(2) prepended by Andrew Howroyd, Sep 16 2018

A053468 Number of directed 3-multigraphs on n nodes.

Original entry on oeis.org

1, 10, 720, 703760, 9168331776, 1601371799340544, 3837878966366932639744, 128777257564337108286016980992, 61454877497308462618188532330410573824, 422314689395950135433730499958070655419345928192
Offset: 1

Author

Vladeta Jovovic, Jan 13 2000

Keywords

Crossrefs

Programs

  • Mathematica
    Table[CoefficientList[PairGroupIndex[SymmetricGroup[n],s,Ordered]/.Table[s[i]->4,{i,1,2 Binomial[n,2]}],x],{n,1,8}] (* Geoffrey Critzer, Oct 20 2012 *)
    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[2*GCD[v[[i]], v[[j]]], {i, 2, Length[v]}, {j, 1, i - 1}] + Total[v - 1];
    a[n_] := (s=0; Do[s += permcount[p]*4^edges[p], {p, IntegerPartitions[n]}]; s/n!);
    Array[a, 15] (* Jean-François Alcover, Jul 08 2018, after Andrew Howroyd *)
  • 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, 2*gcd(v[i],v[j]))) + sum(i=1, #v, v[i]-1)}
    a(n) = {my(s=0); forpart(p=n, s+=permcount(p)*4^edges(p)); s/n!} \\ Andrew Howroyd, Oct 22 2017
    
  • Python
    from itertools import combinations
    from math import prod, gcd, factorial
    from fractions import Fraction
    from sympy.utilities.iterables import partitions
    def A053468(n): return int(sum(Fraction(1<<((sum(p[r]*p[s]*gcd(r,s) for r,s in combinations(p.keys(),2))<<1)+sum(q*r**2 for q, r in p.items())-s<<1),prod(q**r*factorial(r) for q, r in p.items())) for s, p in partitions(n,size=True))) # Chai Wah Wu, Jul 10 2024

Formula

a(n) = A003086(2n) = A000171(4n). - Andrey Zabolotskiy, Feb 21 2021

A047660 Number of self-complementary 2-plexes.

Original entry on oeis.org

1, 1, 0, 1, 2, 40, 0, 703760, 131328, 300241541128192, 0, 28170013344558609991874248704, 24595658799308603392, 9502080486519653717758562294813775233459455787008, 0
Offset: 1

Keywords

Crossrefs

Extensions

More terms from Vladeta Jovovic

A051251 Number of self-complementary 3-plexes.

Original entry on oeis.org

1, 1, 1, 0, 0, 0, 0, 128, 16384, 33554432, 1466015678464, 0, 0, 0, 0, 53919893334301279589334030174039266539571147379908773492703549718528, 63657374260452690195888927762793067532858387480466469420624374174610161798791164116074496
Offset: 1

Keywords

Crossrefs

A054931 Number of unlabeled connected graphs up to complementarity.

Original entry on oeis.org

1, 0, 0, 1, 5, 34, 331, 4949, 123764, 5713987, 497201633, 81514244540, 25084892188043, 14476409634230317, 15684138157859087576, 31969052260961397580693, 122903899605317560183278680, 893542862676093238616261481156, 12317116802837365393131147013965260
Offset: 1

Author

N. J. A. Sloane, May 24 2000

Keywords

Crossrefs

Programs

Formula

a(n) = A001349(n) - (1/2)*A000088(n) + (1/2)*A000171(n). (see Eq. (4) in Liskovets) - Emeric Deutsch, Nov 18 2004

Extensions

More terms from Emeric Deutsch, Nov 18 2004
Terms a(18) and beyond from Andrew Howroyd, Sep 17 2018

A055973 Number of unlabeled digraphs with loops (relations) on n nodes and with an even number of arcs.

Original entry on oeis.org

1, 1, 6, 52, 1540, 145984, 48467296, 56141454464, 229148555640864, 3333310786076963968, 174695272746896566439424, 33301710992539090379269318144, 23278728241293494584257987458067456, 60084295633556503802059558812644803074048, 576025077880237078776946976495257043823396069376
Offset: 0

Author

Vladeta Jovovic, Jul 19 2000

Keywords

Comments

Also relations considered equivalent when isomorphic and when complemented. - Christian G. Bower, Jan 05 2004

Formula

a(2*n) = (A000595(2*n) + A047832(n))/2; a(2*n+1) = A000595(2*n+1)/2.
a(n) = (A000595(n) + A000171(2*n+1))/2.
a(n) = sum {1*s_1+2*s_2+...=n, 1*t_1+2*t_2=2} (fixA[s_1, s_2, ...;t_1, t_2]/(1^s_1*s_1!*2^s_2*s_2!*...*1^t_1*t_1!*2^t_2*t_2!)) where fixA[...] = prod {i, j>=1} ( (sum {d|lcm(i, j)} (d*t_d))^(gcd(i, j)*s_i*s_j)) - Christian G. Bower, Jan 05 2004

Extensions

a(0)=1 prepended and terms a(13) and beyond from Andrew Howroyd, Apr 19 2020
Showing 1-10 of 16 results. Next