[go: up one dir, main page]

login
Revision History for A054921 (Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
Number of connected unlabeled symmetric relations (graphs with loops) having n nodes.
(history; published version)
#35 by Michael De Vlieger at Wed Jul 10 15:02:51 EDT 2024
STATUS

reviewed

approved

#34 by Michel Marcus at Wed Jul 10 14:36:23 EDT 2024
STATUS

proposed

reviewed

#33 by Chai Wah Wu at Wed Jul 10 13:47:11 EDT 2024
STATUS

editing

proposed

#32 by Chai Wah Wu at Wed Jul 10 13:46:34 EDT 2024
PROG

return sum(mobius(d)*c(n//d) for d in divisors(n, generator=True))//n if n else 1 # Chai Wah Wu, Jul 10 2024

#31 by Chai Wah Wu at Wed Jul 10 13:46:13 EDT 2024
PROG

return sum(mobius(d)*c(n//d) for d in divisors(n, generator=True))//n if n else 1 # _Chai Wah Wu_, Jul 10 2024

#30 by Chai Wah Wu at Wed Jul 10 13:45:44 EDT 2024
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

def A054921(n):

@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 if n else 1

STATUS

approved

editing

#29 by Bruno Berselli at Fri Oct 26 02:47:23 EDT 2018
STATUS

proposed

approved

#28 by Michel Marcus at Fri Oct 26 02:16:53 EDT 2018
STATUS

editing

proposed

#27 by Michel Marcus at Fri Oct 26 02:16:50 EDT 2018
LINKS

Edward A. Bender and E. Rodney Canfield, <a href="https://doi.org/10.1016/0095-8956(83)90040-0">Enumeration of connected invariant graphs</a>, Journal of Combinatorial Theory, Series B 34.3 (1983): 268-278. See p. 273.

STATUS

approved

editing

#26 by N. J. A. Sloane at Thu Oct 25 15:25:03 EDT 2018
STATUS

editing

approved