- function isPrime(num)
- {
- for (var i = 2; i < num; i++)
- {
- if (num % i === 0)
- {
- return false;
- }
- }
- return true;
- }
- function display()
- {
- count = 0;
- n = 1;
- VALUE = 0;
- while (n)
- {
- if (count <= 10001)
- {
- if (isPrime(n))
- {
- count += 1;
- VALUE = n;
- }
- }
- else
- {
- break;
- }
- n++;
- }
- alert(VALUE);
- }
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10 001st prime number?
