Problems 3 and 7 and library of primes-related function "Primes"