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

A004104 Number of self-dual signed graphs with n nodes. Also number of self-complementary 2-multigraphs on n nodes.

Original entry on oeis.org

1, 1, 2, 6, 20, 86, 662, 8120, 171526, 5909259, 348089533, 33883250874, 5476590066777, 1490141905609371, 666003784522738152, 509204473666338077658, 636051958071749028811326, 1375164117171886868027357906, 4844133410739656724629165903483, 29777568550007746192195431057341474
Offset: 1

Views

Author

Keywords

Comments

A 2-multigraph is similar to an ordinary graph except there are 0, 1 or 2 edges between any two nodes (self-loops are not allowed).
Of a(1) through a(22) only a(3) = 2 is prime. - Jonathan Vos Post, Feb 19 2011

References

  • F. Harary and R. W. Robinson, Exposition of the enumeration of point-line-signed graphs, pp. 19 - 33 of Proc. Second Caribbean Conference Combinatorics and Computing (Bridgetown, 1977). Ed. R. C. Read and C. C. Cadogan. University of the West Indies, Cave Hill Campus, Barbados, 1977. vii+223 pp.
  • R. W. Robinson, personal communication.
  • R. W. Robinson, Numerical implementation of graph counting algorithms, AGRC Grant, Math. Dept., Univ. Newcastle, Australia, 1976.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • 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_] := Sum[Sum[If[Mod[v[[i]]*v[[j]], 2] == 0, GCD[v[[i]], v[[j]]], 0], {j, 1, i - 1}], {i, 2, Length[v]}] + Sum[If[Mod[v[[i]], 2] == 0, Quotient[v[[i]], 4]*2, 0], {i, 1, Length[v]}];
    a[n_] := Module[{s = 0}, Do[s += permcount[p]*3^edges[p], {p, IntegerPartitions[n]}]; s/n!];
    Table[a[n], {n, 1, 25}] (* Jean-François Alcover, Feb 27 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) = {sum(i=2, #v, sum(j=1, i-1, if(v[i]*v[j]%2==0, gcd(v[i],v[j])))) + sum(i=1, #v, if(v[i]%2==0, v[i]\4*2))}
    a(n) = {my(s=0); forpart(p=n, s+=permcount(p)*3^edges(p)); s/n!} \\ Andrew Howroyd, Sep 16 2018
    
  • Python
    from itertools import combinations
    from math import prod, gcd, factorial
    from fractions import Fraction
    from sympy.utilities.iterables import partitions
    def A004104(n): return int(sum(Fraction(3**(sum(p[r]*p[s]*gcd(r,s) for r,s in combinations(p.keys(),2) if not (r&1 and s&1))+sum(((q>>1)&-2)*r+(q*r*(r-1)>>1) for q, r in p.items() if q&1^1)),prod(q**r*factorial(r) for q, r in p.items())) for p in partitions(n))) # Chai Wah Wu, Jul 09 2024

Extensions

More terms from Vladeta Jovovic, Jan 19 2000
a(18)-a(20) added by Andrew Howroyd, Sep 16 2018
Showing 1-1 of 1 results.