What is the smallest integer n > 0 so that the first digit (not the units digit) of 1 3 n , 2 3 n , and 7 9 n is 9 ?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
what language ?
There is no easy way to solve this problem. The most efficient way is to write a computer program (it literally does what would would normally take you months to compute).
Here is a Python 3.4 program that I used to solve this problem.
a n can be written as 1 0 n ⋅ l g ( a )
1 3 5 = 1 0 5 ⋅ l g ( 1 3 ) = 1 0 5 . 5 6 9
1 0 5 . 5 6 9 = 1 0 5 ⋅ 1 0 0 . 5 6 9
Notice the powers whole part only adds 0's to the number.
Because we are only interested in the first digit we only look at the fractional part of the power.
p o w = n ⋅ l g ( a ) − f l o o r ( n ⋅ l g ( a ) )
p o w is in range between 0 and 1, much easier to compute than doing large integer multiplication.
First digit of number a n is the same as the first digit of 1 0 p o w
1 0 0 . 5 6 9 = 3 . 7 1 2 9 3 = > 3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Nice! That is a clever way to solve the problem that I didn't think about.
Problem Loading...
Note Loading...
Set Loading...
Mathematica
n=1;While[Union[First@IntegerDigits@#&/@{13^n,23^n,79^n}]!={9},n++];n
returns 5529