Tree indexing function
index = node(d,b)
depth from root of tree
index among the 2^d possibilities in a left-right scan at that depth
linear index of node in tree structure