project_euler.problem_063.sol1

The 5-digit number, 16807=75, is also a fifth power. Similarly, the 9-digit number, 134217728=89, is a ninth power. How many n-digit positive integers exist which are also an nth power?

Functions

solution(→ int)

Returns the count of all n-digit numbers which are nth power

Module Contents

project_euler.problem_063.sol1.solution(max_base: int = 10, max_power: int = 22) int

Returns the count of all n-digit numbers which are nth power >>> solution(10, 22) 49 >>> solution(0, 0) 0 >>> solution(1, 1) 0 >>> solution(-1, -1) 0