Sum of sequence of nodes in a tree