home

Scientific Computing (Psychology 9040a)

Fall, 2020

Nth Prime Number

Write a short program to find the Nth prime number. The first five prime numbers are: 2, 3, 5, 7, 11.

Test your program against these examples:

Enter N: 5
The 5th prime number is 11

and

Enter N: 20
The 20th prime number is: 71

and

Enter N: 10000
The 10000th prime number is: 104729