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.

A053514 Number of 3-multigraphs with loops on n nodes.

This page as a plain text file.
%I A053514 #17 Jul 10 2024 02:59:31
%S A053514 4,40,816,48400,9333312,6202675584,14372025574144,117323908831879296,
%T A053514 3413309842639341263872,357775914831345583881365504,
%U A053514 136403808102564598893326677037056,190699341738365392248566307143860137984
%N A053514 Number of 3-multigraphs with loops on n nodes.
%H A053514 Andrew Howroyd, <a href="/A053514/b053514.txt">Table of n, a(n) for n = 1..50</a>
%t A053514 permcount[v_] := Module[{m = 1, s = 0, k = 0, t}, For[i = 1, i <= Length[v], i++, t = v[[i]]; k = If[i > 1 && t == v[[i - 1]], k + 1, 1]; m *= t*k; s += t]; s!/m];
%t A053514 edges[v_] := Sum[GCD[v[[i]], v[[j]]], {i, 2, Length[v]}, {j, 1, i - 1}] + Total[Quotient[v, 2] + 1];
%t A053514 a[n_] := (s=0; Do[s += permcount[p]*4^edges[p], {p, IntegerPartitions[n]}]; s/n!);
%t A053514 Array[a, 15] (* _Jean-François Alcover_, Jul 08 2018, after _Andrew Howroyd_ *)
%o A053514 (PARI)
%o A053514 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 A053514 edges(v) = {sum(i=2, #v, sum(j=1, i-1, gcd(v[i],v[j]))) + sum(i=1, #v, v[i]\2 + 1)}
%o A053514 a(n) = {my(s=0); forpart(p=n, s+=permcount(p)*4^edges(p)); s/n!} \\ _Andrew Howroyd_, Oct 22 2017
%o A053514 (Python)
%o A053514 from itertools import combinations
%o A053514 from math import prod, gcd, factorial
%o A053514 from fractions import Fraction
%o A053514 from sympy.utilities.iterables import partitions
%o A053514 def A053514(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())<<1),prod(q**r*factorial(r) for q, r in p.items())) for p in partitions(n))) # _Chai Wah Wu_, Jul 09 2024
%Y A053514 Cf. A000666, A053400, A053513.
%K A053514 easy,nonn
%O A053514 1,1
%A A053514 _Vladeta Jovovic_, Jan 14 2000
%E A053514 a(12) from _Andrew Howroyd_, Oct 22 2017