Homepage › Solution manuals › Ivan Niven › An Introduction to the Theory of Numbers › Exercise 4.5.13* (There is exactly one power of $2$ having $k$ digits with leading digit $1$)
Exercise 4.5.13* (There is exactly one power of $2$ having $k$ digits with leading digit $1$)
For any integer , prove that there is exactly one power of having exactly digits with leading digit , when written in standard fashion to base . For example . Prove also that there is exactly one power of having exactly digits with leading digit not equal to .
Answers
Proof.
- (a)
-
If
is a positive integer,
has exactly
digits with leading digit
if and only if
Since
is never a power of
, this is equivalent to
Moreover,
There is exactly one power of having exactly digits with leading digit , given by , where
Example:
sage: k = 17 sage: j = 1 + floor((k - 1) * log(10,2)); j 54 sage: 2^j 18014398509481984 - (b)
-
Similarly,
has exactly
digits with leading digit not equal to
if and only if
(since
is never a power of
), and
There is exactly one power of having exactly digits with leading digit not equal to , given by , where
Example:
sage: k = 5 sage: j = floor( k * log(10, 5)) sage: 5^j 78125