Python Range Stack Overflow Error On Recursion Definition