132379

What is the smallest integer n > 0 n > 0 so that the first digit (not the units digit) of 1 3 n 13^n , 2 3 n 23^n , and 7 9 n 79^n is 9 9 ?


The answer is 5529.

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.

3 solutions

Giorgos K.
Mar 29, 2018

Mathematica

n=1;While[Union[First@IntegerDigits@#&/@{13^n,23^n,79^n}]!={9},n++];n

returns 5529

what language ?

Stefan Popescu - 3 years, 2 months ago

Log in to reply

Mathematica

Giorgos K. - 3 years, 2 months ago
Stefan Popescu
Mar 25, 2018

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.

Vismantas Stonkus
Apr 10, 2018

a n a^n can be written as 1 0 n l g ( a ) 10^{n \cdot lg(a)}

1 3 5 = 1 0 5 l g ( 13 ) = 1 0 5.569 13^5 = 10^{5 \cdot lg(13)} = 10^{5.569}

1 0 5.569 = 1 0 5 1 0 0.569 10^{5.569} = 10^5 \cdot 10^{0.569}

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 ) ) pow = n \cdot lg(a) - floor(n \cdot lg(a))

p o w pow is in range between 0 and 1, much easier to compute than doing large integer multiplication.

First digit of number a n a^n is the same as the first digit of 1 0 p o w 10^{pow}

1 0 0.569 = 3.71293 = > 3 10^{0.569} = 3.71293 => 3

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
for(int n = 1; true; n++){
        double pow1 = n * log10(13);
        double pow2 = n * log10(23);
        double pow3 = n * log10(79);
        pow1 -= floor(pow1);
        pow2 -= floor(pow2);
        pow3 -= floor(pow3);

        int digit1 = pow(10, pow1);
        int digit2 = pow(10, pow2);
        int digit3 = pow(10, pow3);

        if(digit1 == 9 && digit2 == 9 && digit3 == 9){
            cout << n;
            break;
        }
    } 

Nice! That is a clever way to solve the problem that I didn't think about.

Stefan Popescu - 3 years, 2 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...