algorithm for finding prime numbers in array of elements [0..10000000]