add function that can search for the next digit that works for a product
slight refactoring

switching from vector to lists for try-next-digit and support