protected override int Descendant(int i, int index, int branch) { int modulo = Tree1.Count(i); int index1 = index % modulo; int index2 = index / modulo; int branch1 = branch % 3; int branch2 = branch / 3; modulo = Tree1.Count(i + 1); return(Tree1.Descendant(i, index1, branch1) + Tree2.Descendant(i, index2, branch2) * modulo); }