views:

124

answers:

1

How can I use threading to write a program that finds the prime numbers between 0 and 1001?

+1  A: 

Assign a unique number n between 1 and 500 inclusive to 500 threads. Then check 2*n+1 for primality in its respective thread, displaying those values of 2*n+1 which are prime.

andand