Trying an exercise with prime numbers