login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 0
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
LINKS
EXAMPLE
First few terms where each line represents a complete binary tree:
n=0: 0
n=1: 1 0 0
n=2: 2 1 1 0 0 0 0
n=3: 3 2 2 1 1 1 1 0 0 0 0 0 0 0 0
n=4: 4 3 3 ...
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)] ].
PROG
(Haskell)
concat [ tree n | n <- [0..] ]
where tree 0 = [0]
tree n = [ i+1 | i <- tree (n-1) ] ++ [ 0 | i <- [1..2^n] ]
CROSSREFS
Cf. A290255, A126646 (row lengths).
Sequence in context: A259829 A035185 A339659 * A244600 A288558 A362831
KEYWORD
nonn,tabf
AUTHOR
Marc van Dongen, Dec 18 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 17:42 EDT 2024. Contains 371254 sequences. (Running on oeis4.)