Question: is there a way to find prime numbers

Answer: Yes, In mathematics, the sieve of Eratosthenes is a simple, ancient algorithm for finding all prime numbers up to any given limit.