Advertisement
Guest User

Neo-Fibonacci (recursive solution)

a guest
Feb 11th, 2015
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.14 KB | None | 0 0
  1. #returns the nth Neo-Fibonacci number
  2. def neo_fib(n):
  3.     if n <= 3:
  4.         return 1
  5.     return neo_fib(n-1) + neo_fib(n-2) + neo_fib(n-3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement