 Furthermore, there are exactly formula_19 nodes contained in the layers up to and including layer formula_17 (think of binary arithmetic; 0111...111 = 1000...000 - 1).Because the root is stored at 0, the formula_21th node will be stored at index formula_22.Putting these observations together yields the following expression for the index of the last node in layer l.

Let there be formula_24 nodes after node formula_13 in layer L, such that

Each of these formula_24 nodes must have exactly 2 children, so there must be formula_28 nodes separating formula_13's right child from the end of its layer (formula_30).