Functions for finding divisors and prime numbers