title: Calculating the number of nodes in a tree when each level has diffrent number of nodes
body: <p>Let's say have we this kind of tree:
  <a href="http://up400.siz.co.il/up1/tymmh2wylmmo.png" rel="nofollow">http://up400.siz.co.il/up1/tymmh2wylmmo.png</a></p>
  
  <p>When the height of the tree is some H, and each level in the tree can have different number of nodes.
  For example, the root level has 3 nodes ("x" in the picture), the next level each node has 2 nodes("y" in the picture), the next level each node has 4 nodes ("z" in the picture), and so on...</p>
  
  <p>Is there any formula for calculating these kind of trees, when the H is given, and the number of nodes (for each node) is given?</p>
  
  <p>Thanks!</p>