Why do factorials of big numbers have so many trailing zeros?

621 Views Asked by At

For example

999!  = 402387260077093773543702433923003985719374864210714632543799910429    
   9385123986290205920442084869694048004799886101971960586316668729948085589 
   0132382966994459099742450408707375991882362772718873251977950595099527612 
   0874975462497043601418278094646496291056393887437886487337119181045825783 
   6478499770124766328898359557354325131853239584630755574091142624174743493 
   4755342864657661166779739666882029120737914385371958824980812686783837455 
   9731746136085379534524221586593201928090878297308431392844403281231558611 
   0369768013573042161687476096758713483120254785893207671691324484262361314 
   1250878020800026168315102734182797770478463586817016436502415369139828126 
   4810213092761244896359928705114964975419909342221566832572080821333186116 
   8115536158365469840467089756029009505376164758477284218896796462449451607 
   6535340819890138544248798495995331910172335555660213945039973628075013783 
   7615307127761926849034352625200015888535147331611702103968175921510907788 
   0193931781141945452572238655414610628921879602238389714760885062768629671 
   4667469756291123408243920816015378088989396451826324367161676217916890977 
   9911903754031274622289988005195444414282012187361745992642956581746628302 
   9555702990243241531816172104658320367869061172601587835207515162842255402 
   6517048330422614397428693306169089796848259012545832716822645806652676995 
   8652682272807075781391858178889652208164348344825993266043367660176999612 
   8318607883861502794659551311565520360939881806121385586003014356945272242 
   0634463179746059468257310379008402443243846565724501440282188525247093519 
   0620929023136493273497565513958720559654228749774011413346962715422845862 
   3773875382304838656889764619273838149001407673104466402598994902222217659 
   0433990188601856652648506179970235619389701786004081188972991831102117122 
   9845901641921068884387121855646124960798722908519296819372388642614839657 
   3822911231250241866493531439701374285319266498753372189406942814341185201 
   5801412334482801505139969429015348307764456909907315243327828826986460278 
   9864321139083506217095002597389863554277196742822248757586765752344220207 
   5736305694988250879689281627538488633969099598262809561214509948717012445 
   1646126037902930912088908694202851064018215439945715680594187274899809425 
   4742173582401063677404595741785160829230135358081840096996372524230560855 
   9037006242712434169090041536901059339838357779394109700277534720000000000 
   0000000000000000000000000000000000000000000000000000000000000000000000000 
   0000000000000000000000000000000000000000000000000000000000000000000000000 
   0000000000000000000000000000000000000000000000000000000000000000000000000 
   00000000000000000
3

There are 3 best solutions below

1
On BEST ANSWER

Because if you multiply an even number and a multiple of $5$ you get a multiple of $10$. Naturally, the larger the number, the more multiples of $10$ it has.

Namely, the number of trailing zeros of $n!$ is $$\sum_{k=1}^n\left\lfloor\frac n{5^k}\right\rfloor$$

Note that this sum has only finitely many non-zero terms.

For $n=999$ is $$199+39+7+1=246$$

0
On

Whenever you have a multiple of $2$ and a multiple of $5$, we introduce at least one trailing $0$.

For a big number $n$, there are many multiple of $2$ and $5$ are less than that number, hence the phenomenon.

0
On

Because they are products of all sorts of numbers, half of which are divisible by $2$ and one fifth by $5$ and that is without taking not account $4,8,16\dots$ and $25,125,625 \dots$. And every time you get $2\times 5$ you add another trailing zero.