Problem 16 (Pascal): Power digit sum