|
![](/i/fill.gif) |
On 22-9-2009 21:20, andrel wrote:
>> 4) By their nature, factorials tend to accumulate trailing zeroes. For
>> example, 5! (120) has one trailing zero, 10! (3628800) has two trailing
>> zeroes, 25! (15511210043330985984000000) has six trailing zeroes, etc.
>>
>> Give a (non-recursive) mathematical function which, for an integer n,
>> gives the number of trailing zeroes in n!.
>
> just count the number of 5s, 25s, 125s etc
BTW I did write a quick and dirty arbitrary precision integer thing to
compute some factorials. I saw the answer before actually having to use
it, but here is 100!:
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
in case you wanted to know.
Post a reply to this message
|
![](/i/fill.gif) |