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.
%I A338971 #46 May 05 2023 07:53:11 %S A338971 0,1,0,0,2,1,1,0,0,0,0,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0,4,3,3,2,2,2,2,1, %T A338971 1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,4,4,3,3,3,3,2,2,2,2, %U A338971 2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 %N A338971 Linear representation of the complete labeled binary trees of all integer heights, where the nodes at level i, 0 <= i <= n, of a binary tree with height n are labeled with the number n-i. %e A338971 First few terms where each line represents a complete binary tree: %e A338971 n=0: 0 %e A338971 n=1: 1 0 0 %e A338971 n=2: 2 1 1 0 0 0 0 %e A338971 n=3: 3 2 2 1 1 1 1 0 0 0 0 0 0 0 0 %e A338971 n=4: 4 3 3 ... %e A338971 Using this representation, the first row r(0) is given by [0]; row(n+1) is given by adding 1 to each member of r(n) and appending 2^(n+1) 0's: r(0) = [0], r(n+1) = [ i + 1 | i <- r(n) ] ++ [ 0 | i <- [1..2^(n+1)] ]. %o A338971 (Haskell) %o A338971 concat [ tree n | n <- [0..] ] %o A338971 where tree 0 = [0] %o A338971 tree n = [ i+1 | i <- tree (n-1) ] ++ [ 0 | i <- [1..2^n] ] %Y A338971 Cf. A290255, A126646 (row lengths). %K A338971 nonn,tabf %O A338971 0,5 %A A338971 _Marc van Dongen_, Dec 18 2020