<jupyter_start><jupyter_text>Problem 63 Powerful digit countsThe $5$-digit number, $16807 = 7^5$, is also a fifth power. Similarly, the $9$-digit number, $134217728 = 8^9$, is a ninth power.How many $n$-digit positive integers exist which are also an $n$th power?OEIS Sequence: [A132722](https://oeis.org/A132722) Solution<jupyter_code>from euler.big_int import BigInt
def compute() -> int:
    result = 0
    for i in range(1, 10):
        j, n = 1, BigInt(i)
        while len(n) == j:
            result += 1
            j += 1
            n *= i
    return result
compute()
%timeit -n 100 -r 1 -p 6 compute()<jupyter_output>530.045 µs ± 0 ns per loop (mean ± std. dev. of 1 run, 100 loops each)
{'fraction_non_alphanumeric': 0.12607449856733524, 'fraction_numerical': 0.08166189111747851, 'mean_word_length': 2.861878453038674, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '607910', 'license': 'MIT', 'n_tokens_mistral': 290, 'n_tokens_neox': 242, 'n_words': 91, 'path': 'problems/0063/solution.ipynb', 'repo_name': 'Dynortice/didactic-rotary-phone', 'size': '698'}