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.

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

Original entry on oeis.org

1, 1, 3, 5, 10, 17, 33, 62, 127, 267, 587, 1326, 3085, 7326, 17731, 43585, 108563, 273544, 696113, 1787042, 4623125, 12043071, 31565842, 83200763, 220413272, 586625403, 1567930743, 4207181144, 11329835687, 30613313339, 82975300030, 225552632043, 614787508640
Offset: 2

Views

Author

Alois P. Heinz, Aug 29 2012

Keywords

Examples

			a(5) = 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  .
		

Crossrefs

Column k=2 of A215977.
The labeled version is A215852.

Programs

  • Maple
    with(numtheory):
    b:= proc(n) option remember; local d, j; `if` (n<=1, n,
          (add(add(d*b(d), d=divisors(j)) *b(n-j), j=1..n-1))/(n-1))
        end:
    g:= proc(n) option remember; local k; `if`(n>2, 1, 0)+ b(n)-
          (add(b(k)*b(n-k), k=0..n) -`if`(irem(n, 2)=0, b(n/2), 0))/2
        end:
    p:= proc(n, i, t) option remember; `if`(n p(n, n, 2):
    seq(a(n), n=2..40);
  • 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, translated from Maple *)
  • 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

Formula

a(n) ~ c * d^n / n^(5/2), where d = A051491 = 2.9557652856519949747148..., c = 0.3339525664158379... . - Vaclav Kotesovec, Sep 07 2014