title: Calculating Catalan Numbers
body: <p>I am trying to use this code to calculate the Catalan Number in Python, but it just does not work. How can I fix it?</p>
  
  <p>Here is the code I have:</p>
  
  <pre><code>def catalan_rec(n):
      if n == 0:
          return 1
      else:
          b = 0
          for i in range (n):
              b += sum((catalan_rec(i))*(catalan_rec(n-1-i)))
      return b
  </code></pre>