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.

Showing 1-3 of 3 results.

A340022 Number of graphs with vertices labeled with positive integers summing to n.

Original entry on oeis.org

1, 1, 3, 7, 22, 71, 319, 1939, 19790, 377259, 14603435, 1144417513, 176665721300, 52525450429119, 29719386740326525, 31836493683553082697, 64474640381705842520802, 246962703426353769596309789, 1791765285568042699367722904797, 24670014908867411635732865067513309
Offset: 0

Views

Author

Andrew Howroyd, Jan 01 2021

Keywords

Crossrefs

Programs

  • Mathematica
    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[GCD[v[[i]], v[[j]]], {i, 2, Length[v]}, {j, 1, i - 1}] + Total[Quotient[v, 2]];
    seq[n_] := 1 + Sum[s = 0; Do[s += permcount[p]*2^edges[p]*x^k/Product[1 - x^p[[j]] + O[x]^(n-k+1), {j, 1, Length[p]}],{p, IntegerPartitions[k]}]; s/k!, {k, 1, n}] // CoefficientList[#, x]&;
    seq[19] (* Jean-François Alcover, Jan 06 2021, after Andrew Howroyd *)
  • PARI
    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, gcd(v[i], v[j]))) + sum(i=1, #v, v[i]\2)}
    seq(n) = {Vec(1+sum(k=1, n, my(s=0); forpart(p=k, s+=permcount(p) * 2^edges(p) * x^k/prod(j=1, #p, 1 - x^p[j] + O(x^(n-k+1)))); s/k!))}

A340023 Number of graphs with n integer labeled vertices covering an initial interval of positive integers.

Original entry on oeis.org

1, 1, 4, 24, 263, 5566, 239428, 21074412, 3779440490, 1372163701412, 1003687569555456, 1474604145003923000, 4343524388729516494384, 25623424478746329214500144, 302549202766446393276528844768, 7147753721248229224770005386691680
Offset: 0

Views

Author

Andrew Howroyd, Jan 01 2021

Keywords

Examples

			a(2) = 4 because there are 2 graphs on 2 vertices and each of these can either have both vertices labeled 1 or one vertex labeled 1 and the other 2.
		

Crossrefs

Programs

  • Mathematica
    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[GCD[v[[i]], v[[j]]], {i, 2, Length[v]}, {j, 1, i - 1}] + Total[Quotient[v, 2]];
    G[n_, k_] := Module[{s = 0}, Do[s += permcount[p]*2^edges[p]*k^Length[p], {p, IntegerPartitions[n]}]; s/n!];
    a[n_] := Module[{p = G[n, x]}, Sum[(p /. x -> k)*Sum[Binomial[r, k]*(-1)^(r - k), {r, k, n}], {k, 0, n}]];
    a /@ Range[0, 15] (* Jean-François Alcover, Jan 06 2021, after Andrew Howroyd *)
  • PARI
    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, gcd(v[i], v[j]))) + sum(i=1, #v, v[i]\2)}
    G(n,k)={my(s=0); forpart(p=n, s+=permcount(p)*2^edges(p)*k^#p); s/n!}
    a(n)={my(p=G(n,x)); sum(k=0, n, subst(p,x,k)*sum(r=k, n, binomial(r, k)*(-1)^(r-k)))}

A340027 Number of inequivalent vertex colorings of connected graphs on n unlabeled vertices.

Original entry on oeis.org

1, 1, 2, 7, 50, 520, 10665, 400220, 29204589, 4143245857, 1146827743079, 619412332805088, 653237982066620540, 1346571060160843394520, 5432476352054378478159877, 42947950068987980977264834190, 666212968663987333085874313873428, 20301440661023158546856805172595805762
Offset: 0

Views

Author

Andrew Howroyd, Jan 02 2021

Keywords

Comments

Equivalence is up to permutation of the colors. Adjacent vertices may have the same color.

Examples

			a(3) = 7 because there are 2 connected graphs on 3 vertices. The complete graph K_3 can be coloring in 3 ways (111, 112, 123) and the path graph P_3 can be colored in 4 ways (111, 112, 121, 123).
		

Crossrefs

Programs

  • PARI
    \\ See links in A339645 for combinatorial species functions.
    edges(v) = {sum(i=2, #v, sum(j=1, i-1, gcd(v[i], v[j]))) + sum(i=1, #v, v[i]\2)}
    graphsCycleIndex(n)={my(s=0); forpart(p=n, s+=permcount(p) * 2^edges(p) * sMonomial(p)); s/n!}
    graphsSeries(n)={sum(k=0, n, graphsCycleIndex(k)*x^k) + O(x*x^n)}
    InequivalentColoringsSeq(1+sLog(graphsSeries(15)))
Showing 1-3 of 3 results.