A361366 Number of unlabeled simple planar digraphs with n nodes.
1, 3, 16, 218, 9026, 907123
Offset: 1
References
- M. Kirchweger, M. Scheucher, and S. Szeider, SAT-Based Generation of Planar Graphs, in preparation.
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.
Triangle begins: 1; 0, 1; 1, 0, 2; 5, 5, 0, 6; 90, 55, 42, 0, 31; 5289, 2451, 974, 592, 0, 302; 1071691, 323709, 94332, 29612, 15616, 0, 5984; ...
Needs["Combinatorica`"]; d[n_] := GraphPolynomial[n, x, Directed] /. x -> 1; max = 12; se = Series[ Sum[ a[n]*x^n/n, {n, 1, max}] - Log[1 + Sum[ d[n]*x^n, {n, 1, max}]], {x, 0, max}]; sol = SolveAlways[ se == 0, x]; A003084 = Table[ a[n], {n, 1, max}] /. sol[[1]] (* Jean-François Alcover, Feb 01 2012, after formula *) terms = 15; 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]; edges[v_] := Sum[2*GCD[v[[i]], v[[j]]], {i, 2, Length[v]}, {j, 1, i - 1}] + Total[v - 1]; d[n_] := (s = 0; Do[s += permcount[p]*2^edges[p], {p, IntegerPartitions[n]} ]; s/n!); CoefficientList[Log[Sum[ d[n] x^n, {n, 0, terms + 1}]] + O[x]^(terms + 1), x] Range[0, terms] // Rest (* Jean-François Alcover, Aug 29 2019, after Andrew Howroyd in A000273 *)
from functools import lru_cache from itertools import product from fractions import Fraction from math import prod, gcd, factorial from sympy import mobius, divisors from sympy.utilities.iterables import partitions def A054590(n): @lru_cache(maxsize=None) def b(n): return int(sum(Fraction(1<Chai Wah Wu, Jul 05 2024
A000273 = Cases[Import["https://oeis.org/A000273/b000273.txt", "Table"], {, }][[All, 2]]; A003086 = Cases[Import["https://oeis.org/A003086/b003086.txt", "Table"], {, }][[All, 2]]; a[n_] := (A000273[[n + 1]] - A003086[[n]])/2; Array[a, 50] (* Jean-François Alcover, Sep 12 2019, after Andrew Howroyd *)
Triangle T(n,k) begins: 1; 0, 1; 2, 0, 1; 13, 2, 0, 1; 202, 13, 2, 0, 1; 9390, 202, 13, 2, 0, 1; 1531336, 9390, 202, 13, 2, 0, 1; ...
b:= proc(n, i, l) `if`(n=0 or i=1, 1/n!*2^((p-> add(p[j]-1+add( igcd(p[k], p[j]), k=1..j-1)*2, j=1..nops(p)))([l[], 1$n])), add(b(n-i*j, i-1, [l[], i$j])/j!/i^j, j=0..n/i)) end: g:= proc(n) option remember; b(n$2, []) end: T:= (n, k)-> g(n-k)-`if`(kAlois P. Heinz, Sep 04 2019
Needs["Combinatorica`"]; f[list_]:=Insert[Select[list,#>0&],0,-2]; nn=10; s=Sum[NumberOfDirectedGraphs[n]x^n, {n,0,nn}]; Drop[Flatten[Map[f, CoefficientList[Series[s (1-x)/(1-y x), {x,0,nn}], {x,y}]]], 1] (* Second program: *) b[n_, i_, l_List] := If[n==0 || i==1, 1/n!*2^(Function[p, Sum[p[[j]] - 1 + Sum[GCD[p[[k]], p[[j]]], {k, 1, j - 1}]*2, {j, 1, Length[p]}]][Join[l, Array[1&, n]]]), Sum[b[n - i*j, i - 1, Join[l, Array[i&, j]]]/j!/i^j, {j, 0, n/i}]]; g[n_] := g[n] = b[n, n, {}]; T[n_, k_] := g[n - k] - If[k < n, g[n - k - 1], 0]; Table[Table[T[n, k], {k, 0, n}], {n, 0, 10}] // Flatten (* Jean-François Alcover, Dec 07 2019, after Alois P. Heinz *)
n=2: We label node 1 with (1,1) in the relation and node 2 with (2,2) not in the relation, and we have two differently labeled nodes and so a(2) = A053763(2) = 4. n=3: We have exactly either one or two nodes x with (x,x) in the relation. In A328773 this labelings correspond to the color schemes [2,1] and [1,2], both represented by the column index 2. So we have a(3) = 2 * A328773(3,2) = 72.
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]; edges[v_] := Sum[2*GCD[v[[i]], v[[j]]], {i, 2, Length[v]}, {j, 1, i - 1}] + Total[v]; a[n_] := Module[{s = 0}, Do[t = 2^edges[p]; s += t*(1 - 2^(1 - Length[p]))* permcount[p], {p, IntegerPartitions[n]}]; s/n!]; Array[a, 14] (* Jean-François Alcover, Jan 08 2021, after Andrew Howroyd *)
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} edges(v) = {sum(i=2, #v, sum(j=1, i-1, 2*gcd(v[i], v[j]))) + sum(i=1, #v, v[i])} a(n) = {my(s=0); forpart(p=n, my(t=2^edges(p)); s+=t*(1 - 2^(1-#p))*permcount(p)); s/n!} \\ Andrew Howroyd, Nov 02 2019
Partitions for n=4, k=2: [3,1] and [2,2] with indices 2 and 3: T(4,2) = Sum_{i=2,3} A328773(4,i) = 752 + 1104 = 1856. Partitions for n=6, k=3: [4,1,1], [3,2,1], [2,2,2] with indices 4, 6, 8: T(6,3) = Sum_{i=4,6,8} A328773(6,i) = 45277312 + 90196736 + 135032832 = 270506880. Triangle T(n,k) begins: 1 3 4 16 36 64 218 1856 2112 4096 9608 136376 445440 528384 1048576 1540944 62020640 270506880 449511424 537919488 1073741824 ...
\\ here C(p) computes A328773 sequence value for given partition. 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} edges(v) = {sum(i=2, #v, sum(j=1, i-1, 2*gcd(v[i], v[j]))) + sum(i=1, #v, v[i]-1)} C(p)={((i, v)->if(i>#p, 2^edges(v), my(s=0); forpart(q=p[i], s+=permcount(q)*self()(i+1, concat(v, Vec(q)))); s/p[i]!))(1, [])} Row(n)={[vecsum(apply(C, vecsort([Vecrev(p) | p<-partitions(n),#p==m], , 4))) | m<-[1..n]]} { for(n=0, 10, print(Row(n))) }
Comments