Fixed problem 3 for powers of primes