Prime numbers are positive integers that are divisible only by 1 and themselves without a remainder. Write a program to find the prime numbers between 0 and 1000.
You can use a few tricks to make your program more efficient. Test all the numbers up to the square root of the number. If the number has an integer square root, then obviously it has factors other than 1 and itself.
Do you know that mathematicians have never found a formula that can predict with perfect accuracy the spacing of prime numbers? It seems that there is no regular pattern to their occurrence!
One method for finding Prime numbers is:
Repeat this process until you have reached the end of the list, or there are no more uncrossed numbers to process. The Circled numbers are the primes.
Write a program to find all the primes between 1 and 10 000 using this method.