- #1

- 166

- 0

sorry if this is kind of pointless

- Thread starter soandos
- Start date

- #1

- 166

- 0

sorry if this is kind of pointless

- #2

mathman

Science Advisor

- 7,877

- 453

For large n, use Stirling's formula:

n! ~ (2[pi]n)^{1/2} (n/e)^{n}

n! ~ (2[pi]n)

- #3

CRGreathouse

Science Advisor

Homework Helper

- 2,820

- 0

O(x log x).is there a way to determine (does not need to be exact) the number of digits in x! ?

To be more precise, x log x - x log e + O(log x), where the base of the logarithms is the base you want to express the number.

- #4

Gib Z

Homework Helper

- 3,346

- 5

[tex]D = 1 + \lfloor \log_{10} \lfloor n! \rfloor \rfloor [/tex]

after that for the number of digits.

- #5

disregardthat

Science Advisor

- 1,861

- 34

If [tex]n![/tex] is hard to calculate, the series

[tex]D = 1 + \lfloor \log_{10} \lfloor n! \rfloor \rfloor [/tex]

after that for the number of digits.

[tex]D = 1 + \lfloor \sum^n_{i=1} \log_{10}i \rfloor[/tex]

should be easier to calculate - for integer [tex]n[/tex].

- #6

Gib Z

Homework Helper

- 3,346

- 5

Depends how large n is. If it's quite large, calculating logs for each term up to it may not be easier than using Stirlings Formula which simplifies into something that doesn't look that bad after a log anyway. But that definitely is a good idea =]If [tex]n![/tex] is hard to calculate, the series

[tex]D = 1 + \lfloor \sum^n_{i=1} \log_{10}i \rfloor[/tex]

should be easier to calculate - for integer [tex]n[/tex].

- #7

- 166

- 0

I do no mean truncating the answer, but more the way a person would, so for example,

1/"insert incredibly long hard to calculate mess here" as zero, or instead of getting the inside of a natural log to hundreds of decimal points, just get it to 10 or so.

is there a way to do that?

- Last Post

- Replies
- 3

- Views
- 1K

- Last Post

- Replies
- 7

- Views
- 3K

- Last Post

- Replies
- 1

- Views
- 2K

- Last Post

- Replies
- 5

- Views
- 2K

- Last Post

- Replies
- 5

- Views
- 1K

- Last Post

- Replies
- 4

- Views
- 2K

- Last Post

- Replies
- 4

- Views
- 688

- Replies
- 12

- Views
- 3K

- Last Post

- Replies
- 1

- Views
- 572

- Replies
- 3

- Views
- 1K