title: Loop creating indiced of tree branches
body: <p>How can a loop be implemented in Python which returns the indices of tree branches and where the number of tree branches per layer depth grows by the layer depth to the power of n? n and the <em>layer depth</em> shall both be integer numbers.</p>
  <p>E.g. for n=2 and this would yield for the first three layers the following number of tree branches (the indices are given in the black boxes):</p>
  <p>Layer depth 0: 2**0=1</p>
  <p>Layer depth 1: 2**1=2</p>
  <p>Layer depth 2: 2**2=4</p>
  <p><a href="https://i.stack.imgur.com/EpHSW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EpHSW.png" alt="enter image description here" /></a></p>
  <p>E.g. for n=3 and this would yield for the first three layers the following number of tree branches (the indices are given in the black boxes):</p>
  <p>Layer depth 0: 3**0=1</p>
  <p>Layer depth 1: 3**1=3</p>
  <p>Layer depth 2: 3**2=9</p>
  <p><a href="https://i.stack.imgur.com/Dg06a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Dg06a.png" alt="enter image description here" /></a></p>