algorithm please!!

Design a program that finds all numbers from 1 to 1000 whose prime factors, when added
together, sum up to a prime number (for example, 12 has prime factors of 2, 2, and 3, which
sum to 7, which is prime). Implement the code for that algorithm.

Here’s the algorithm with the code for finding out the prime factors of a number:-

  1. Incorporate the above algorithm.
  2. sum+=prime_factor
  3. For i=1 to sizeof(A)
    if (sum == A[i])
    /store all the prime numbers up till 997 (using Sieve of Eratosthenes : ) in an array A.
    print number

It can be solved much faster for much larger limits, since products of prime numbers increase very very quickly. Even with just a backtrack over all subsets of prime numbers.