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.

A375467 Triangle read by rows: Number of unlabeled rooted trees with n vertices where the level of a vertex is bounded by k.

This page as a plain text file.
%I A375467 #22 Sep 11 2024 12:31:52
%S A375467 0,0,1,0,0,1,0,0,1,2,0,0,1,3,4,0,0,1,5,8,9,0,0,1,7,15,19,20,0,0,1,11,
%T A375467 29,42,47,48,0,0,1,15,53,89,108,114,115,0,0,1,22,98,191,252,278,285,
%U A375467 286,0,0,1,30,177,402,582,676,710,718,719
%N A375467 Triangle read by rows: Number of unlabeled rooted trees with n vertices where the level of a vertex is bounded by k.
%C A375467 The level of a vertex is the number of vertices in the path from the root to the vertex, the level of the root is 1.
%F A375467 The rows accumulate the rows of A034781.
%e A375467 Triangle starts:
%e A375467   [0] [0]
%e A375467   [1] [0, 1]
%e A375467   [2] [0, 0, 1]
%e A375467   [3] [0, 0, 1,  2]
%e A375467   [4] [0, 0, 1,  3,  4]
%e A375467   [5] [0, 0, 1,  5,  8,   9]
%e A375467   [6] [0, 0, 1,  7, 15,  19,  20]
%e A375467   [7] [0, 0, 1, 11, 29,  42,  47,  48]
%e A375467   [8] [0, 0, 1, 15, 53,  89, 108, 114, 115]
%e A375467   [9] [0, 0, 1, 22, 98, 191, 252, 278, 285, 286]
%p A375467 div := n -> numtheory:-divisors(n):
%p A375467 H := proc(n, k) option remember; local d; add(d * T(d, k), d = div(n)) end:
%p A375467 T := proc(n, k) option remember; local i; if n = 1 then ifelse(k > 0, 1, 0) else add(T(i, k) * H(n - i, k - 1), i = 1..n - 1) / (n - 1) fi end:
%p A375467 seq(print(seq(T(n, k), k = 0..n)), n = 0..9):  # _Peter Luschny_, Sep 11 2024
%o A375467 (Python)
%o A375467 from functools import cache
%o A375467 @cache
%o A375467 def Divisors(n: int) -> list[int]:
%o A375467     return [d for d in range(n, 0, -1) if n % d == 0]
%o A375467 @cache
%o A375467 def H(n: int, k: int) -> int:
%o A375467     return sum(d * T(d, k) for d in Divisors(n))
%o A375467 @cache
%o A375467 def T(n: int, k: int) -> int:
%o A375467     if k == 0: return 0
%o A375467     if n == 1: return int(k > 0)
%o A375467     return sum(T(i, k) * H(n - i, k - 1)
%o A375467            for i in range(1, n) ) // (n - 1)
%o A375467 for n in range(10): print([T(n, k) for k in range(n + 1)])
%o A375467 # _Peter Luschny_, Sep 11 2024
%Y A375467 Cf. A000081 (main diagonal), A375468 (row sums), A034781.
%K A375467 nonn,tabl
%O A375467 0,10
%A A375467 _Peter Luschny_, Aug 29 2024