3
$\begingroup$

Suppose you have a number $n^m$. Is there a way to figure out how many 1s it contains "easily"? For large numbers, this probably means you do this without computing the value. What about 2s, or other digits?

Are there specific values of n, m for which you can (e.g. n is prime)?

This question arose when I was working on a recreational maths problem. At one point it was necessary to count how many 1s there are in a large prime power but I could not see how to do this without a calculator.

$\endgroup$
  • 1
    $\begingroup$ I'm pretty sure there isn't a way. at least not for all numbers. $\endgroup$ – Jorge Fernández Hidalgo Mar 17 '13 at 1:23
  • $\begingroup$ If your $n$ isn't divisible by $10$, I'd try using Euler's theorem for $10^k$ for each $k$th digit. $\endgroup$ – Alexander Gruber Mar 17 '13 at 4:55
  • 1
    $\begingroup$ If I were asked to do this, I'd give $\frac{m \times \log n}{10}$, as the answer, and hope that gods of probability are on my side :) $\endgroup$ – xylon97 Mar 17 '13 at 12:27
1
$\begingroup$

To give you some idea of how hard this kind of problem is, $2^{86}=77371252455336267181195264$ is conjectured to be the greatest power of $2$ whose decimal representation has no zeros, but no one knows how to prove this. See this entry at the Online Encyclopedia of Integer Sequences.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.