cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A052111 Number of self-complementary 2-multigraphs with loops on n nodes.

This page as a plain text file.
%I A052111 #12 Jul 09 2024 15:22:37
%S A052111 1,2,5,24,120,956,13214,275848,10613479,601955190,63788179593,
%T A052111 9985272721908,2906903866536978,1268802939666164781,
%U A052111 1023198355173637429689,1258181815243248217067175,2834890911778762731361375215,9900896274205100008273760895560
%N A052111 Number of self-complementary 2-multigraphs with loops on n nodes.
%C A052111 A 2-multigraph is similar to an ordinary graph except there are 0, 1 or 2 edges between any two nodes (self-loops are not allowed).
%H A052111 Andrew Howroyd, <a href="/A052111/b052111.txt">Table of n, a(n) for n = 1..50</a>
%o A052111 (PARI)
%o A052111 permcount(v) = {my(m=1,s=0,k=0,t); for(i=1,#v,t=v[i]; k=if(i>1&&t==v[i-1],k+1,1); m*=t*k;s+=t); s!/m}
%o A052111 edges(v) = {sum(i=2, #v, sum(j=1, i-1, if(v[i]*v[j]%2==0, gcd(v[i],v[j])))) + sum(i=1, #v, if(v[i]%2==0, v[i]\4*2+1))}
%o A052111 a(n) = {my(s=0); forpart(p=n, s+=permcount(p)*3^edges(p)); s/n!} \\ _Andrew Howroyd_, Sep 16 2018
%o A052111 (Python)
%o A052111 from itertools import combinations
%o A052111 from math import prod, gcd, factorial
%o A052111 from fractions import Fraction
%o A052111 from sympy.utilities.iterables import partitions
%o A052111 def A052111(n): return int(sum(Fraction(3**(sum(p[r]*p[s]*gcd(r,s) for r,s in combinations(p.keys(),2) if not (r&1 and s&1))+sum(((q>>1)|1)*r+(q*r*(r-1)>>1) for q, r in p.items() if q&1^1)),prod(q**r*factorial(r) for q, r in p.items())) for p in partitions(n))) # _Chai Wah Wu_, Jul 09 2024
%Y A052111 Cf. A053513, A004104.
%K A052111 nonn
%O A052111 1,2
%A A052111 _Vladeta Jovovic_, Jan 21 2000
%E A052111 Terms a(17) and beyond from _Andrew Howroyd_, Sep 16 2018