Don't expect me to do these calculations!

Algebra Level 3

21 ! 1000 \large \color{#3D99F6}{21!}^{\color{#69047E}{1000}}

Find the total number of digits when the number above is expressed in decimal representation.

Details and Assumptions

  • It is twenty-one factorial raised to the power of one thousand.

  • You may use the fact that 21 ! = 51 , 090 , 942 , 171 , 709 , 440 , 000 21! = 51,090,942,171,709,440,000


The answer is 19709.

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.

2 solutions

You all must have noticed that

1 0 1 = 10^{1} = The first appearance of a 2 digit number

1 0 2 = 10^{2} = The first appearance of a 3 digit number

and so on

1 0 x 1 = 10^{x-1} = The first appearance of a x x digit number .

So , to find the number of digits in 21 ! 1000 21!^{1000} , we do the following calculations 21 ! 1000 = 1 0 x 1 l o g 10 21 ! 1000 = ( x 1 ) 1000 l o g 10 21 ! = ( x 1 ) 1000 19.70834 = ( x 1 ) x = 19709 21!^{1000} = 10^{x-1} \\ log_{10} 21!^{1000} = (x-1) \\ 1000\cdot log_{10} 21! = (x-1) \\ 1000\cdot 19.70834 = (x-1) \\ \Rightarrow x=19709

NOTE : Here even if x 1 x-1 evaluated out to be 19.709.9 19.709.9 , we wouldn't round it to 19710 19710 since we are talking about the number of digits , not it's value .

Yes the same way :) All the best for your jee main :)

Smarth Mittal - 6 years, 3 months ago

Log in to reply

Thank you @Smarth Mittal ¨ \ddot\smile

A Former Brilliant Member - 6 years, 3 months ago
Jaikirat Sandhu
Feb 20, 2015

There are many ways to solve this question. Two of them are : 1) An efficient code of c++; :P // generic solution template <class T> int numDigits(T number) { int digits = 0; if (number < 0) digits = 1; // remove this line if '-' counts as a digit while (number) { number /= 10; digits++; } return digits; }

// partial specialization optimization for 32-bit numbers template<> int numDigits(int32 t x) { if (x == MIN INT) return 10 + 1; if (x < 0) return numDigits(-x) + 1;

if (x >= 10000) {
    if (x >= 10000000) {
        if (x >= 100000000) {
            if (x >= 1000000000)
                return 10;
            return 9;
        }
        return 8;
    }
    if (x >= 100000) {
        if (x >= 1000000)
            return 7;
        return 6;
    }
    return 5;
}
if (x >= 100) {
    if (x >= 1000)

2) If no. of digits = x. Then,

1 0 x 1 10^{x-1} = 21 ! 1000 21!^{1000} Taking log_10 on both sides,

x-1 = 1000*log(21!) Using a calculator, log(21!) = 19.708344 :P Therefore, x-1 = 19708.344 x = 19709.344 Taking the truncate value (not the round value) x = 19709

3) Another way is use of MySql code, Use Select length(21!^1000) from dual; But first convert 21!^1000 to integer. Enjoy !!!!!!!

I don't know how to use these languages

so had to go by the second way :)

Smarth Mittal - 6 years, 3 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...