| Soorena (15) | |
|
please give me a formula to find for example n! contain how many characters? example: n= 10 result = 7 | |
|
|
|
| Chervil (1205) | |
|
You can find the number of digits without calculating the actual factorial by using Stirling's approximation. An approximation of n! is sqrt(2*pi*n) * (n/e)^nTake the log to base 10 and add 1 to find the number of decimal digits. 0.5*log10(2*pi*n) + n*log10(n/e) + 1
| |
|
|
|
| Soorena (15) | |
| thank you very much | |
|
|
|