Novel approach to finding prime numbers and factoring composites