A054922 Number of connected unlabeled symmetric relations (graphs with loops) having n nodes such that complement is also connected.
2, 0, 0, 10, 164, 2670, 56724, 1867860, 104538928, 10461483366, 1912179618740, 644464839239880, 402785011941549964, 468944407349226545614, 1021179521951204217530900, 4174755063830188009750183026
Offset: 1
Links
- Andrew Howroyd, Table of n, a(n) for n = 1..50
- V. A. Liskovets, Some easily derivable sequences, J. Integer Sequences, 3 (2000), #00.2.2.
Programs
-
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]]; a[n_] := 2*A054921[[n + 1]] - A000666[[n + 1]]; Array[a, 50] (* Jean-François Alcover, Aug 31 2019 *)
-
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 def A054922(n): @lru_cache(maxsize=None) def b(n): return int(sum(Fraction(1<
>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
Extensions
More terms from Vladeta Jovovic, Jul 17 2000