Prime numbers algorithm.