The $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?
Let’s break down the problem:
Firstly, consider the fact that in order to have an n-digit number, it must be the number “10^(n-1) <= x^n <10^n". This meets the condition because "10^(n-1)" means there's an integer with (n-1)+1 or n digits and "less than 10^n" means there's less than n+1 digits. Therefore, the smallest the base "x" can be is 1, and the largest it can be is 10 because at 10, the number becomes too large (it immediately becomes a number with n+1 digits). Now, consider the fact that "x^n" is an increasing function for "x > 0″. This means that if we have a solution for a particular “n”, we don’t need to check smaller values of “n” for that “x”. We only need to check larger values.
If we start with “x=1”, we can see that this will work for all values of “n”. When we reach “x=2”, it works up til “n=4”. For “x=3”, it works for “n=2”. For “x=4”, it only works for “n=1”. Similarly, we find that “x=5, 6, 7” and “10” all only work for “n=1”. “x=8” works for “n=1” and “n=9”. “x=9” only works for “n=1”.
Counting all the solutions, we have:
1 solution for n from 1 to 21 (for x=1)
4 solutions for n from 1 to 4 (for x=2)
2 solutions for n from 1 to 2 (for x=3)
1 solution for n = 1 (for x from 4 to 7)
2 solutions for n = 1 and n = 9 (for x=8)
1 solution for n = 1 (for x from 9 to 10)
Adding all these up, we have 1*21 + 4 + 2 + 4 + 2 + 1 = 21 + 4 + 2 + 4 + 2 + 1 = 34.
So there are 34 n-digit positive integers which are also an nth power.
More Answers:
Prime Pair SetsCyclical Figurate Numbers
Cubic Permutations