Completed finding the nth prime