title: Using recursion to raise a base to an exponent to an exponent
body: <p>I'm currently trying to use recursion to raise a base to a power of 2 and then that to an exponent, so it looks like <code>x^2^y</code>. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>def real_multiply(x:int, y:int):
      if y == 0:
          return x
      else:
          return x * real_multiply(x,(2**y)-1)
  </code></pre>
  
  <p>The base case <code>y==0</code> is so that <code>2^0</code> gives back 1, and the output would ultimately be <code>x^1</code>, which would give back <code>x</code>. However, when I run this code, it goes to the recursive limit. </p>
  
  <p>Any ideas?</p>