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.

A053467 Number of directed 2-multigraphs on n nodes.

This page as a plain text file.
%I A053467 #24 Jul 10 2024 15:03:03
%S A053467 1,6,138,22815,29197989,286181094816,21712697070199704,
%T A053467 12980080058620326927885,62082385554465497895132149640,
%U A053467 2405193620328895144597707267893468286,762399006478986275307113015668690102196187810
%N A053467 Number of directed 2-multigraphs on n nodes.
%C A053467 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 A053467 Andrew Howroyd, <a href="/A053467/b053467.txt">Table of n, a(n) for n = 1..40</a>
%t A053467 Table[CycleIndex[PairGroup[SymmetricGroup[n], Ordered], t] /.Table[t[i] -> 1 + x^i + y^i, {i, 1, n^2}] /. {x -> 1, y -> 1}, {n, 1, 7}] (* _Geoffrey Critzer_, Mar 08 2011 *)
%t A053467 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 A053467 edges[v_] := Sum[2*GCD[v[[i]], v[[j]]], {i, 2, Length[v]}, {j, 1, i - 1}] + Total[v - 1];
%t A053467 a[n_] := (s=0; Do[s += permcount[p]*3^edges[p], {p, IntegerPartitions[n]}]; s/n!);
%t A053467 Array[a, 15] (* _Jean-François Alcover_, Jul 08 2018, after _Andrew Howroyd_ *)
%o A053467 (PARI)
%o A053467 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 A053467 edges(v) = {sum(i=2, #v, sum(j=1, i-1, 2*gcd(v[i],v[j]))) + sum(i=1, #v, v[i]-1)}
%o A053467 a(n) = {my(s=0); forpart(p=n, s+=permcount(p)*3^edges(p)); s/n!} \\ _Andrew Howroyd_, Oct 22 2017
%o A053467 (Python)
%o A053467 from itertools import combinations
%o A053467 from math import prod, gcd, factorial
%o A053467 from fractions import Fraction
%o A053467 from sympy.utilities.iterables import partitions
%o A053467 def A053467(n): return int(sum(Fraction(3**((sum(p[r]*p[s]*gcd(r,s) for r,s in combinations(p.keys(),2))<<1)+sum(q*r**2 for q, r in p.items())-s),prod(q**r*factorial(r) for q, r in p.items())) for s, p in partitions(n,size=True))) # _Chai Wah Wu_, Jul 10 2024
%Y A053467 Cf. A000273, A053468.
%K A053467 easy,nonn
%O A053467 1,2
%A A053467 _Vladeta Jovovic_, Jan 13 2000
%E A053467 a(11) from _Andrew Howroyd_, Oct 22 2017