[email protected] wrote:
> could you explain how the following determines the
> approximate
> number of digits in !200e6?
>
> a few examples:
>
> maybe !10e2, !10e4 and !100e6
>

The approximation in conventional mathematical notation is

ln n! is approximately n ln n - n

This comes from

ln n! = ln 1 + ln 2 + ln 3 + .... + ln n

which is a Riemann sum for the integral from 1 to n of ln t dt, and the
latter is (approximately) n ln n - n.

Examples:
stirling=:(* ^.)-]
log10=:(^. 10) %~ stirling

   ]n=:10^>:i.4x
10 100 1000 10000
   10&^. !n
6.55976 157.97 2567.6 35659.5
   log10 n
5.65706 156.571 2565.71 35657.1

On my computer, it is hard to go much beyond this for the exact result.

Best wishes,

John


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to