Advanced happy new year!

Given that x ! x! has 2016 trailing zeros , find the minimum value of x x .


The answer is 8075.

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.

4 solutions

Akshat Sharda
Dec 6, 2015

Using Trailing Number of Zeros , we want

2016 = n 5 + n 5 2 + n 5 3 + 2016=\left \lfloor \frac{n}{5} \right \rfloor+ \left \lfloor \frac{n}{5^2} \right \rfloor+ \left \lfloor \frac{n} {5^3} \right \rfloor+\ldots

Using an approximation from Geometric Progression Sum ,

2016 = n 5 1 1 5 2016=\frac{\frac{n}{5}}{1-\frac{1} {5}}

2016 = n 4 n = 8064 2016=\frac{n}{4}\Rightarrow n=8064

Number of zeroes in 8064 ! = 2012 8064!=2012 .

Therefore to get four more zeroes (i.e. 2016 2016 zeroes) the answer must be 8075 \boxed{8075} .


Quicker Approximation

x = 4 n x=4n where x ! x! has n n zeroes.

I didnt get the 2 line

Mr Yovan - 5 years, 6 months ago

Log in to reply

It seems, he is approximating it to an infinite geometric progression, neglecting the floor function. That would be an approximate number lesser than the correct answer for some sufficiently large n.

Harish Sasikumar - 5 years, 6 months ago

Log in to reply

thank you for the explanation

Mr Yovan - 5 years, 6 months ago

The answer which is inch perfect would be 8340. check it out

Aditya Narayan Sharma - 5 years, 6 months ago

Log in to reply

The factorial of 8340 has 2082 zeroes.

A Former Brilliant Member - 5 years, 6 months ago

Log in to reply

e= [8340/5] + [8340/25] + [8340/625] + [8340/3125] + ..... = 1668 + 333 + 13 + 2 + 0 = 2016

Aditya Narayan Sharma - 5 years, 6 months ago

Log in to reply

@Aditya Narayan Sharma You are missing 8340 125 = 66 \left \lfloor \frac{8340}{125} \right \rfloor =66

Akshat Sharda - 5 years, 6 months ago

Log in to reply

@Akshat Sharda Thanks. My mistake. :) these silly mistakes are my nightmares

Aditya Narayan Sharma - 5 years, 6 months ago

Implementation Trailing Number of Zeros , I use C++

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#include<bits/stdc++.h>
using namespace std;

int main(){
long long a,b,c;

a=5;
cin>>b;  //INPUT=8075
while(a<b){
    c=c+(long long)ceil(b/a);
    a*=5;
}

cout<<c<<endl; //OUTPUT=2016

}

Ramiel To-ong
Dec 14, 2015

nice and brief solution

Atul Shivam
Dec 10, 2015

No. of trailing zeroes for any number say n n is [ n 5 ] + [ n 25 ] + [ n 125 ] + . . . [\frac{n}{5}]+[\frac{n}{25}]+[\frac{n}{125}]+... where [ . ] [.] is greatest integer function for n N n€N using this I got minimum value of n equal to 8075 \boxed{8075}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...