OFFSET
0,5
EXAMPLE
The a(4) = 2 through a(6) = 14 edge-sets:
{} {} {}
{12,34} {12,34} {12,34}
{12,35,45} {12,34,56}
{12,34,35,45} {12,35,45}
{12,34,35,45}
{12,35,46,56}
{12,36,46,56}
{13,23,46,56}
{12,34,35,46,56}
{12,36,45,46,56}
{13,23,45,46,56}
{12,13,23,45,46,56}
{12,35,36,45,46,56}
{12,34,35,36,45,46,56}
PROG
(Python)
from functools import lru_cache
from itertools import combinations
from fractions import Fraction
from math import prod, gcd, factorial
from sympy import mobius, divisors
from sympy.utilities.iterables import partitions
def A327235(n):
if n == 0: return 1
@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)*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))
def a(n): return sum(mobius(n//d)*c(d) for d in divisors(n, generator=True))//n if n else 1
return 1+b(n)-sum(a(i) for i in range(1, n+1)) # Chai Wah Wu, Jul 03 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Sep 01 2019
EXTENSIONS
a(20)-a(21) from Chai Wah Wu, Jul 03 2024
STATUS
approved