Calculating the n-th prime number in Python