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.

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.

This page as a plain text file.
%I A215977 #29 Nov 02 2022 11:53:04
%S A215977 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,
%T A215977 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,
%U A215977 53,26,13,6,3,1,1,0,236,267,189,106,55,26,13,6,3,1,1
%N 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.
%H A215977 Alois P. Heinz, <a href="/A215977/b215977.txt">Rows n = 0..140, flattened</a>
%e A215977 T(4,1) = 3: .o-o.  .o-o.  .o-o.
%e A215977             .| |.  .|  .  .|\ .
%e A215977             .o-o.  .o-o.  .o o.
%e A215977 .
%e A215977 T(4,2) = 3: .o-o.  .o-o.  .o-o.
%e A215977             .|/ .  .|  .  .   .
%e A215977             .o o.  .o o.  .o-o.
%e A215977 .
%e A215977 T(5,1) = 4: .o-o-o.  .o-o-o.  .o-o-o.  .o-o-o.
%e A215977             .|  / .  .|    .  .| |  .  . /|  .
%e A215977             .o-o  .  .o-o  .  .o o  .  .o o  .
%e A215977 .
%e A215977 T(5,2) = 5: .o-o o.  .o-o o.  .o-o o.  .o o-o.  .o o-o.
%e A215977             .| |  .  .|    .  .|\   .  .|\   .  .|    .
%e A215977             .o-o  .  .o-o  .  .o o  .  .o-o  .  .o-o  .
%e A215977 Triangle T(n,k) begins:
%e A215977   1;
%e A215977   0,  1;
%e A215977   0,  1,  1;
%e A215977   0,  2,  1,  1;
%e A215977   0,  3,  3,  1,  1;
%e A215977   0,  4,  5,  3,  1,  1;
%e A215977   0,  7, 10,  6,  3,  1,  1;
%e A215977   0, 12, 17, 12,  6,  3,  1,  1;
%e A215977   ...
%t A215977 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)];
%t A215977 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;
%t A215977 p[n_, i_, t_] := p[n, i, t] = If[n<t, 0, If[n == t, 1,If[Min[i, t]<1, 0, Sum[Binomial[g[i]+j-1, j]*p[n-i*j, i-1, t-j], {j, 0, Min[n/i, t]}]]]];
%t A215977 T[n_, k_] := p[n, n, k] // FullSimplify;
%t A215977 Table[T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* _Jean-François Alcover_, Dec 04 2014, after _Alois P. Heinz_ *)
%o A215977 (Python)
%o A215977 from sympy.core.cache import cacheit
%o A215977 from sympy import binomial, divisors
%o A215977 @cacheit
%o A215977 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)
%o A215977 @cacheit
%o A215977 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
%o A215977 @cacheit
%o A215977 def p(n, i, t): return 0 if n<t else 1 if n==t else 0 if min(i, t)<1 else sum(binomial(g(i) + j - 1, j)*p(n - i*j, i - 1, t - j) for j in range(min(n//i, t) + 1))
%o A215977 def T(n, k): return p(n, n, k)
%o A215977 for n in range(21): print([T(n, k) for k in range(n + 1)]) # _Indranil Ghosh_, Aug 07 2017
%Y A215977 Columns k=0-10 give: A000007, A215981, A215982, A215983, A215984, A215985, A215986, A215987, A215988, A215989, A215980.
%Y A215977 Row sums give: A215978.
%Y A215977 Limiting sequence of reversed rows gives: A215979.
%Y A215977 The labeled version of this triangle is A215861.
%K A215977 nonn,tabl
%O A215977 0,8
%A A215977 _Alois P. Heinz_, Aug 29 2012