Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- prime_pos = 10001
- req_prime = -1
- number = 2
- while(1):
- i = 2
- isPrime = 1
- while((i*i)<=number):
- if((number%i) == 0):
- isPrime = 0
- break;
- i = i + 1
- if(isPrime):
- req_prime = number
- prime_pos = prime_pos - 1
- if(prime_pos == 0):
- break;
- number = number + 1
- print("The 10001st prime is:",req_prime);
- # OUTPUT:
- # The 10001st prime is: 104743
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement