title: Recursive is_prime function in python 3.x
body: <p>In my school's Computer Science 2 class we are currently exploring recursion. We have already used recursion to do things like factorial or the Fibonacci sequence, but are stuck on an <code>is_prime(n)</code> function which returns True if n is prime, otherwise returning False. We wrote one iteratively previously, but can not seem to figure out how to do it recursively. This is what we have so far:  </p>
  
  <pre><code>def is_prime(n):
  
      if n &lt; 2: return False
      #1 or 0 is not prime, base case 1
  
      if n == 2 or n == 3: return True
      #2 and 3 are both prime, base case 2
  
      if is_prime(n-1): return False
      #This checks if n-1 is prime, b/c if so then n must not be prime
      #However, this only works b/c the first few numbers have lots of primes
  
      return True
      #Only returns True if nothing else has returned
  </code></pre>
  
  <p>If anyone could help us out a little, preferably through just a couple hints, that would be great. Thanks!</p>