Project Euler 29 - Distinct powers

Official link: https://projecteuler.net/problem=29