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-2 of 2 results.

A215977 Number T(n,k) of simple unlabeled graphs on n nodes with exactly k connected components that are trees or cycles; triangle T(n,k), n >= 0, 0 <= k <= n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 2, 1, 1, 0, 3, 3, 1, 1, 0, 4, 5, 3, 1, 1, 0, 7, 10, 6, 3, 1, 1, 0, 12, 17, 12, 6, 3, 1, 1, 0, 24, 33, 23, 13, 6, 3, 1, 1, 0, 48, 62, 47, 25, 13, 6, 3, 1, 1, 0, 107, 127, 92, 53, 26, 13, 6, 3, 1, 1, 0, 236, 267, 189, 106, 55, 26, 13, 6, 3, 1, 1
Offset: 0

Views

Author

Alois P. Heinz, Aug 29 2012

Keywords

Examples

			T(4,1) = 3: .o-o.  .o-o.  .o-o.
            .| |.  .|  .  .|\ .
            .o-o.  .o-o.  .o o.
.
T(4,2) = 3: .o-o.  .o-o.  .o-o.
            .|/ .  .|  .  .   .
            .o o.  .o o.  .o-o.
.
T(5,1) = 4: .o-o-o.  .o-o-o.  .o-o-o.  .o-o-o.
            .|  / .  .|    .  .| |  .  . /|  .
            .o-o  .  .o-o  .  .o o  .  .o o  .
.
T(5,2) = 5: .o-o o.  .o-o o.  .o-o o.  .o o-o.  .o o-o.
            .| |  .  .|    .  .|\   .  .|\   .  .|    .
            .o-o  .  .o-o  .  .o o  .  .o-o  .  .o-o  .
Triangle T(n,k) begins:
  1;
  0,  1;
  0,  1,  1;
  0,  2,  1,  1;
  0,  3,  3,  1,  1;
  0,  4,  5,  3,  1,  1;
  0,  7, 10,  6,  3,  1,  1;
  0, 12, 17, 12,  6,  3,  1,  1;
  ...
		

Crossrefs

Row sums give: A215978.
Limiting sequence of reversed rows gives: A215979.
The labeled version of this triangle is A215861.

Programs

  • Mathematica
    b[n_] := b[n] = If[n <= 1, n, Sum[Sum[d*b[d], {d, Divisors[j]}]*b[n-j], {j, 1, n-1}]/(n-1)];
    g[n_] := g[n] = If[n>2, 1, 0]+b[n]-(Sum [b[k]*b[n-k], {k, 0, n}] - If[Mod[n, 2] == 0, b[n/2], 0])/2;
    p[n_, i_, t_] := p[n, i, t] = If[nJean-François Alcover, Dec 04 2014, after Alois P. Heinz *)
  • Python
    from sympy.core.cache import cacheit
    from sympy import binomial, divisors
    @cacheit
    def b(n): return n if n<2 else sum([sum([d*b(d) for d in divisors(j)])*b(n - j) for j in range(1, n)])//(n - 1)
    @cacheit
    def g(n): return (1 if n>2 else 0) + b(n) - (sum(b(k)*b(n - k) for k in range(n + 1)) - (b(n//2) if n%2==0 else 0))//2
    @cacheit
    def p(n, i, t): return 0 if nIndranil Ghosh, Aug 07 2017

A215852 Number of simple labeled graphs on n nodes with exactly 2 connected components that are trees or cycles.

Original entry on oeis.org

1, 3, 19, 135, 1267, 15029, 218627, 3783582, 75956664, 1734309929, 44357222772, 1255715827483, 38971877812380, 1315634598619830, 47994245894462576, 1881406032047006812, 78870928008704884848, 3520953336130828001295, 166762291211479030734580
Offset: 2

Views

Author

Alois P. Heinz, Aug 25 2012

Keywords

Examples

			a(3) = 3:
.1 2.  .1-2.  .1 2.
.|. .  . . .  . / .
.3...  .3...  .3...
		

Crossrefs

Column k=2 of A215861.
The unlabeled version is A215982.

Programs

  • Maple
    T:= proc(n, k) option remember; `if`(k<0 or k>n, 0,
          `if`(n=0, 1, add(binomial(n-1, i)*T(n-1-i, k-1)*
          `if`(i<2, 1, i!/2 +(i+1)^(i-1)), i=0..n-k)))
        end:
    a:= n-> T(n, 2):
    seq(a(n), n=2..25);
  • Mathematica
    T[n_, k_]:=T[n, k]=If[k<0 || k>n, 0, If[n==0, 1, Sum[Binomial[n - 1, i] T[n - 1 - i, k - 1] If[i<2, 1, i!/2 + (i + 1)^(i - 1)], {i, 0, n - k}]]]; Table[T[n, 2], {n, 2, 50}] (* Indranil Ghosh, Aug 07 2017, after Maple *)
  • Python
    from sympy.core.cache import cacheit
    from sympy import binomial, factorial as f
    @cacheit
    def T(n, k): return 0 if k<0 or k>n else 1 if n==0 else sum([binomial(n - 1, i)*T(n - 1 - i, k - 1)*(1 if i<2 else f(i)//2 + (i + 1)**(i - 1)) for i in range(n - k + 1)])
    def a(n): return T(n , 2)
    print([a(n) for n in range(2, 51)]) # Indranil Ghosh, Aug 07 2017, after maple code

Formula

a(n) ~ c * n^(n-2), where c = 0.511564031298... . - Vaclav Kotesovec, Sep 07 2014
Showing 1-2 of 2 results.