Calculates nth Prime Number