# How many 0's are in the end of this expansion?

How many $0's$ are in the end of:

$$1^1 \cdot 2^2 \cdot 3^3 \cdot 4^4.... 99^{99}$$

The answer is supposed to be $1100$ but I have absolutely NO clue how to get there.

• No. of zeroes will be equal to no. of $(5*2)$ in the above product. Also the power of $5$ will be less than the power of $2$ in the above expression(why?). So count the power of $5$ to arrive at the answer. :) Feb 1, 2015 at 9:26
• Find the exponent of $10=2\cdot 5$ in this.
– AvZ
Feb 1, 2015 at 9:29

To find out the number of zeroes at the end of that huge number, we just have to find out the exponent of $10$ in it.
Since $10=2\cdot 5$, we can just find out the exponent of $5$ in that number as the exponent of $2$ will be more than $5$.
All the numbers which have $5$ as their factor will be counted.
These numbers would be
$$5^5,10^{10},15^{15},\ldots,95^{95}$$
We know that all numbers except $25,50$ and $75$ will only contribute themselves as the exponent, whereas the aforementioned numbers, will contribute double of themselves.
So, we have
$$(5+10+\cdots+95)+(75+50+25)=\frac{19}{2}(5+95) + 150=1100$$

• +1. great Answer. But why only the exponent of $5$? Feb 1, 2015 at 10:07
• We know that $10=2\cdot 5$. Also, for the product of these consecutive integers, there will be more even numbers than numbers divisible by $5$. Since $10$ is just basically pair of $2$ and $5$, there will be as many pairs as there are $5$.
– AvZ
Feb 1, 2015 at 10:11
• Okay mmmm.. But if $10 = 2 \cdot 5$ then why cant we just use the exponent of $2$? Feb 1, 2015 at 10:16
• Since there will be more $2$'s than $5$'s, the number of pairs will be equal to exponent of $5$. There will be some extra $2$'s which won't pair with anything.
– AvZ
Feb 1, 2015 at 10:19
• To be sure of the answer, you should look at the number of factors of $2$ as well, but you don't have to look at them as carefully as the factors of $5$. As soon as you have found at least $1100$ factors of $2$ you can stop looking. Consider that there are $25$ even numbers in the range $50$ to $98$, and each contributes at least $50$ factors of $2$ to the product; that's $1250$ factors of $2$ already, so we're done. Feb 1, 2015 at 15:38

There as many zeros as the number of the factors of 5 in the product: So we need to check the subproduct $$5^5\cdot 10^{10}\cdots 95^{95}$$ We have $5+10+15+\cdot+95=5(1+2+\cdots+19)=950$. And we have missed the case where we have two factors: $25,50,75$. So we have another $25+50+75=150$. Altogether $950+150=1100$.

• Why only number factors of 5? Feb 1, 2015 at 9:55

The product is:

3455370853345118990838802242313122606623389778122088884990370421271669193923882564554771184441857869026458316013036415014883393489784972606777266713175708816987206561957362174723308111426612566852543952611450404658454663971171141999208291678635573484392229804269286998706570578482911647395653022419405406117604731607487808330470415854096122751357426455439638200919831190424867061989396882740447015003304385280687442457299143998159749928045561579140365664027592904055624664731591146555017252360323888903470780104945864778241119216626847376745681661834720892606650912385296842573547972487768279950223052165962577116586471851052356970646884866434768551410551488321064217776405882533980590689519893045000716102219479985667760601403109673603204896606819198331375419125453196508911736994546361784184919373796874918809120464767105543407588970923199666788249952086896460217106465749452485901413564758186966495178971102253568655981174061561968251421938374485757042726975753185107372083106264048429911979685197192839686118560007370228066549075876050455548052899706626526188783249002630531455164461863733645940305169379591106897944719208224754289978073817883950239703686697026263214987295140619524989507084227174280944287944901594738155953813670914145150225150121797708689295112652076757379043804958088910850056278274916770875316912676573722848332759814383945441313873350277048801421115534286190506501494803200451644137188724630190484945332836362602941443528240003832695739794504547880606685200979680304898873421271999032805945649153703951207311123201901923354775809600779110906269024969637108593836895916421959098483351303335645187949384740365649561055147141122459926505971127127920747512241648217419625451753297246546472089391684715636171064174603575687475913495880994834831633914497610192261740381805019357138320391068590083279618190175913143773566335807003901227196855273973523675881919894654764663393610337795305945575117114359481179034456472984949651530517989662210866626618657923685485205775488861988788281867137209677836393197656648795003272209286534630704804472937940538863354351707898499949882119835184637555988156054116872532128032806697643881895264335613804969643582260357978711126975024047705632577685201280638701708719197953217156109382318799861276638429561122668446632613767215769809952142801426742185591771963667997456167286438806580343795194045956210593999192381497958372189777699907423672624614499990762777292873028626550070136773359786672022418094637435554425837278797483230143967337534916803648839403716632671946351272631226018590782075269187367435494846931047877424173602097391415582582599208449079077406804615294568061896635188224801506216134054499505944172149543505218446879053131264689899003658504892944812565539705438969928351626606909979346294372479579410531118310026870129841778134366155317716552941169918359417328486885051898097331900038568590274415593104526699961083146419549627398942551039390351764734601053627829557298781752551119237461001860525002187445707071156014824564561718622879947568501823517880052027356102699132908297035823982766479695047135122120671562769915486157974883333165630106029604312342153709293109391797879781631553336086013622050246977708335792893070346203955255628360395624592459086130310364712714133005649127288509065480505843835828173182075539888348258251158569027898353586340683352947862711128486769609240033234453870070351373122762810139413250080637195778446314697268958784442467381440272431498001870679556317680208048450518982350283995762269298865772174510330543749175933646702727851668562445370327726026607971391669022297868615126619456119848975014708319312423485885172879933379353131644496937791510884868960946638262358557110469320933891837379792225203096036943100782655151665122571415657665982808519602747338305228852018227566557364122416667756461527605481014271294730187391150062690601186546751592482547694841145036143921728412192177046016022101557532362432448075961958061285665116828443409355391808567896249402658718681722395934497723703928949721609779017001966519110945274132601222035188914525183064982043669684634305196041641090813147487992147717677650242125509681743494076814289442177318564831493233657689031790531434148685533040153848888817557136608812395522745459108000322225299898558418652162857007582048584962493688582860489715138331187499051574147982683778338049419731257723260249982857835991994957559327253513582585641165969000880231319615338579574474019542933373876664487375698448654080028464445328909673994317299284823514487342670890574761307060330751252131259596212792800576888651120553641039280468924101073843325482051656895768400997637894751093973622285892803355292215639173478593266923714382174027690225416634123908159616453893190558580610080765297653434483023454007814905803562866665632132479765238530581293157270931405436275401361781866975726758026842390360462632192475751724708772172964059979373489400609179140864546393097337607908375543104138706479269234828079092832610509778591718704059540719150940508682728077151682862059765766994700877065555107358154185117034929130716761620813935944664220751622372459465618781087053640612861867976880255354872843397509984924529418929539171667528688598643609108094864222445635143353395517648946771241828330225629508897083310935904456336558801112438028856502912697653805760426773746550979385595818728990010182329901940106732388144097255478888826976064709278251825522837270684160860161850560633978904473960584914819049822326969874259252761387453248334726282878219255066667282071919054108832838282915169954909028617891530873122363326383071124702823986862676170629202222748476769389716626592060707312317945654514171132448539553269639100502481063774156410719566366523733915880505263472052599453939425258618535553113434713742272608413764299934686372246720413119920875862499857088372348846726311824603843831306110944188410020445451551042133229757509818131188909468168332405056196778381977623369414494832314699133875566645870278685242131550189264779457174302622607221283555100953209049337451994217627899108097929796627981072932200210507324529217111919227016755410763068805266113904400534386371765780083142765302512914285571928099398962844148944879635413409232218807727494954137727128190386895920856839811959694456334990529822362919365101302611054389592327813212994724420323484113517188812622261873942290365670784336277850084704989832560196436385505339699186424967967542995433494636711493228982824042052932090275083775606527280419015340247394855844564205799174296038590397135100065162225679330877053337381125408817123902340831800211033692453495119989382753123514709949098996113706382686798499851630881922479681077209790054835823857621399510498510890327160237806621404775483591696722243578199994859103774499464507464274940986909032177352651488079433305919705551927792030824037637923738906778622425606830688176866549637132024625622123205206069348075333561983899763633482103446626231431242490503761178580161341164539644878050655798055513730858608104279545195362101030591878909951092905361814922485750168314735468876557656545896895642762163018290642866046966147930336322819205336394803839661459457023852260662527796097640682187954205180249939825258783636621349504277137048399965708179981573618909717680729345741796589659216738481308798458229459678845320234357172520102721525137413126779734127084111276519994187891029990876295996002765870474243055054189047734544375867829948963437769927079111787165417295954513439416788937074856234237195816274782918698152708946309569173328110829593516749091463480612584751277424305233155260707520288469506110780085763481160265311953980526225271599324657566247892801749573677232333673387326269410008494051253883223163864601069413506857669914261271757522454842438783920615793932911233518796800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

• Looks like Python to me...?
– AvZ
Feb 1, 2015 at 17:46
• @AvZ Well, in this case Mathematica, but python works too. Feb 1, 2015 at 17:59
• So how will you determine the number of zeroes in the end? Factorize? Feb 1, 2015 at 19:32
• @JeppeStigNielsen just copy the terminating string of zeroes to a text editor, go to the end of line and see what column you're at :) Feb 1, 2015 at 19:38
• @JeppeStigNielsen Or copy into an interpreter for the scripting language of your choice, surround in quotes, and take the length of the string! Feb 2, 2015 at 8:35