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.

A131890 a(n) is the number of shapes of balanced trees with constant branching factor 4 and n nodes. The node is balanced if the size, measured in nodes, of each pair of its children differ by at most one node.

This page as a plain text file.
%I A131890 #20 Aug 01 2019 18:19:53
%S A131890 1,1,4,6,4,1,16,96,256,256,1536,3456,3456,1296,3456,3456,1536,256,256,
%T A131890 96,16,1,64,1536,16384,65536,1572864,14155776,56623104,84934656,
%U A131890 905969664,3623878656,6442450944,4294967296,17179869184,25769803776,17179869184,4294967296
%N A131890 a(n) is the number of shapes of balanced trees with constant branching factor 4 and n nodes. The node is balanced if the size, measured in nodes, of each pair of its children differ by at most one node.
%H A131890 Alois P. Heinz, <a href="/A131890/b131890.txt">Table of n, a(n) for n = 0..1365</a>
%H A131890 Jeffrey Barnett, <a href="http://notatt.com/btree-shapes.pdf">Counting Balanced Tree Shapes</a>
%F A131890 a(0) = a(1) = 1; a(4n+1+m) = (4 choose m) * a(n+1)^m * a(n)^(4-m), where n >= 0 and 0 <= m <= 4.
%p A131890 a:= proc(n) option remember; local m, r; if n<2 then 1 else
%p A131890       r:= iquo(n-1, 4, 'm'); binomial(4, m) *a(r+1)^m *a(r)^(4-m) fi
%p A131890     end:
%p A131890 seq(a(n), n=0..50);  # _Alois P. Heinz_, Apr 10 2013
%t A131890 a[n_, k_] := a[n, k] = Module[{m, r}, If[n < 2 || k == 1, 1, If[k == 0, 0, {r, m} = QuotientRemainder[n - 1, k]; Binomial[k, m]*a[r + 1, k]^m*a[r, k]^(k - m)]]];
%t A131890 a[n_] := a[n, 4];
%t A131890 Table[a[n], {n, 0, 50}] (* _Jean-François Alcover_, Jun 04 2018, after _Alois P. Heinz_ *)
%Y A131890 Cf. A110316, A131889, A131891, A131892, A131893.
%Y A131890 Column k=4 of A221857. - _Alois P. Heinz_, Apr 17 2013
%K A131890 easy,nonn
%O A131890 0,3
%A A131890 _Jeffrey Barnett_, Jul 24 2007