put logic into a generalized list-prime function, and defined primes for a range