login
A322700
Number of unlabeled graphs with loops spanning n vertices.
37
1, 1, 4, 14, 70, 454, 4552, 74168, 2129348, 111535148, 10812483376, 1945437208224, 650378721156736, 404749938336404704, 470163239887698967104, 1022592854829028311090816, 4177826139658552046627175072, 32163829440870460348768023969632
OFFSET
0,3
COMMENTS
The span of a graph is the union of its edges. The not necessarily spanning case is A000666.
FORMULA
First differences of A000666.
MATHEMATICA
Table[Sum[2^PermutationCycles[Ordering[Map[Sort, Select[Tuples[Range[n], 2], OrderedQ]/.Rule@@@Table[{i, prm[[i]]}, {i, n}], {1}]], Length], {prm, Permutations[Range[n]]}]/n!, {n, 0, 8}]//Differences (* Mathematica 8.0+ *)
PROG
(Python)
from itertools import combinations
from math import prod, factorial, gcd
from fractions import Fraction
from sympy.utilities.iterables import partitions
def A322700(n): return int(sum(Fraction(1<<sum(p[r]*p[s]*gcd(r, s) for r, s in combinations(p.keys(), 2))+sum(((q>>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))-sum(Fraction(1<<sum(p[r]*p[s]*gcd(r, s) for r, s in combinations(p.keys(), 2))+sum(((q>>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-1))) if n else 1 # Chai Wah Wu, Jul 14 2024
KEYWORD
nonn
AUTHOR
Gus Wiseman, Dec 23 2018
STATUS
approved