Hi, On Feb 13, 2008 1:11 AM, Dave <[EMAIL PROTECTED]> wrote: > > Sum log 1 + log 2 + log 3 + ... + log n, where log represents the > base-10 logarithm function. The ceiling of the sum gives the number of > digits. > > Dave
Yeh, that work fine. Only to explain a bit more to Hariharan: **let N your number I)- First, make cases by hand and convince yourself that the number of digits in a number is equals to exponent of the minor power of 10(ten) which is bigger then N. II)- Remember of the logarithm property learned at high school: - log(x.y) = log(x) + log(y) III)- N! = N.(N-1).(N-2)....1 => log10(N!)= log10(N.(N-1).(N-2)....1) = log10(N) + log10(N-1) + log(N-2)+...+1 Best regards, Caio Valentim --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---
