functions dealing with prime numbers