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.
%I A340021 #15 Feb 16 2025 08:34:01 %S A340021 1,1,2,5,16,66,407,3948,66781,2057140,117820559,12562407832, %T A340021 2488441442819,915216371901462,625792587599236833, %U A340021 797474948692631218674,1899724021357155410243835,8486672841492724213636009230,71324140440429733888694354552551,1131126439181050621704917376323373818 %N A340021 Number of bicolored graphs on n unlabeled nodes such that black nodes are not adjacent to each other and every white node is adjacent to a black node. %C A340021 The black nodes form a maximal independent vertex set (or a set that is both independent and dominating). For n > 0, a(n) is then the total number of indistinguishable maximal independent vertex sets summed over distinct unlabeled graphs with n nodes. %H A340021 Andrew Howroyd, <a href="/A340021/b340021.txt">Table of n, a(n) for n = 0..40</a> %H A340021 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/MaximalIndependentVertexSet.html">Maximal Independent Vertex Set</a> %t A340021 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 A340021 edges[v_] := Sum[GCD[v[[i]], v[[j]]], {i, 2, Length[v]}, {j, 1, i - 1}] + Total[Quotient[v, 2]]; %t A340021 dom[u_, v_] := Product[2^Sum[GCD[u[[i]], v[[j]]], {j, 1, Length[v]}] - 1, {i, 1, Length[u]}]; %t A340021 U[nb_, nw_] := Module[{s = 0}, Do[t = 0; Do[t += permcount[v]*dom[u, v], {v, IntegerPartitions[nb]}]; s += t*permcount[u]*2^edges[u]/nb!, {u, IntegerPartitions[nw]}]; s/nw!]; %t A340021 a[n_] := Sum[U[k, n - k], {k, 0, n}]; %t A340021 Array[a, 20] (* _Jean-François Alcover_, Jan 07 2021, after _Andrew Howroyd_ *) %o A340021 (PARI) %o A340021 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 A340021 edges(v) = {sum(i=2, #v, sum(j=1, i-1, gcd(v[i], v[j]))) + sum(i=1, #v, v[i]\2)} %o A340021 dom(u, v) = {prod(i=1, #u, 2^sum(j=1, #v, gcd(u[i], v[j]))-1)} %o A340021 U(nb, nw)={my(s=0); forpart(u=nw, my(t=0); forpart(v=nb, t += permcount(v) * dom(u, v)); s += t*permcount(u) * 2^edges(u)/nb!); s/nw!} %o A340021 a(n)={sum(k=0, n, U(k, n-k))} %Y A340021 A049312 counts bicolored graphs where adjacent nodes cannot have the same color. %Y A340021 A000666 counts bicolored graphs where adjacent nodes can have the same color. %Y A340021 Cf. A339832 (independent only), A339836 (dominating only), A339837 (trees). %K A340021 nonn %O A340021 0,3 %A A340021 _Andrew Howroyd_, Dec 30 2020