|
|
A054922
|
|
Number of connected unlabeled symmetric relations (graphs with loops) having n nodes such that complement is also connected.
|
|
1
|
|
|
2, 0, 0, 10, 164, 2670, 56724, 1867860, 104538928, 10461483366, 1912179618740, 644464839239880, 402785011941549964, 468944407349226545614, 1021179521951204217530900, 4174755063830188009750183026
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
A000666 = Cases[Import["https://oeis.org/A000666/b000666.txt", "Table"], {_, _}][[All, 2]];
A054921 = Cases[Import["https://oeis.org/A054921/b054921.txt", "Table"], {_, _}][[All, 2]];
|
|
PROG
|
(Python)
from functools import lru_cache
from itertools import combinations
from math import prod, factorial, gcd
from fractions import Fraction
from sympy.utilities.iterables import partitions
from sympy import mobius, divisors
@lru_cache(maxsize=None)
def b(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)))
@lru_cache(maxsize=None)
def c(n): return n*b(n)-sum(c(k)*b(n-k) for k in range(1, n))
return (sum(mobius(d)*c(n//d) for d in divisors(n, generator=True))//n<<1)-b(n) # Chai Wah Wu, Jul 10 2024
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,changed
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|