added recursion but recursion only works up to 1000 prime numbers. My computer seems to run out of memory at this point