[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 3 KB, 251x60, a193e2aad488f09d34cbd01bcb6b9504.jpg [View same] [iqdb] [saucenao] [google]
1214241 No.1214241 [Reply] [Original]

How would one solve the equation 'n! = x' for n?

>> No.1214264

n! = n * (n-1) * (n-2) * ... * 2 * 1

(n-1)! = n!/n
=> (n-1)! * n = n!

>> No.1214261

find the biggest prime factor, it's between that and the next biggest prime.

>> No.1214276

>n! = x
n=x/!

>> No.1214289

>>1214276
you can't divide by!

>> No.1214294

>>1214241
just keep checking the values of n starting with 1
/thread

>> No.1214298

n = <span class="math">\frac{x}{(n-1)!}[/spoiler]

>> No.1214322

oh, i think OP is trying to set up a function.

well, since n! = x, the function is piecewise: f(x) = x! if x is an integer greater than 0, and f(x) = 1 at 0. It is undefined for negative integers.

>> No.1214327

>>1214322
this post gave me cancer

>> No.1214339
File: 10 KB, 251x251, 1275010484087.jpg [View same] [iqdb] [saucenao] [google]
1214339

>>1214322
>It is undefined for negative integers.
lolno

>> No.1214343

>>1214339
Uh yes, it is. The function is only defined for n=0 and n>0.

>> No.1214346

>>1214339
>this post gave me more cancer

>> No.1214349

>>1214343
You can extend the factorial in many ways. The most common used extension is the gamma function, which extends the factorial to all complex numbers except the negative integers.

>> No.1214354

>>1214349
but then it is not the factorial function, is it?

Derp!!!

>> No.1214355

>>1214349
Can you elaborate? I have never heard of this gamma function. (Only done up to calc 2 right now.)

>> No.1214362

>>1214355
> I don't know how to use mathworld or wikipedia or google

>> No.1214370

>>1214355
Wikipedia? You basically start with the definition:
<span class="math"> \Gamma(z) = \int_0^\infty t^{z-1} e^{-t} dt[/spoiler]
and derive easily the functional equation <span class="math">\Gamma(z+1) = z\Gamma(z)[/spoiler].

But the above formula doesn't work for all complex numbers except the negative integers yet, so you still have to do some tweaking.

http://en.wikipedia.org/wiki/Gamma_function

>> No.1214390

http://www.wolframalpha.com/input/?i=solve+gamma%28n%2B1%29+%3D+x+for+n

WolframAlpha's got nothing.

>> No.1214404

For newfags:

<span class="math">\Gamma (s) = \int_0^{\infty} x^{s-1} e^{-x} dx = (s-1) \Gamma(s-1)[/spoiler]

(using integration by parts). Since <span class="math">\Gamma(1) = 1[/spoiler], we have (by induction) <span class="math">\Gamma(s) = (s-1)![/spoiler] for integers. The gamma function is defined on the entire complex plane, except for poles at nonpositive integers.

>>1214241
Try this approximation:
<div class="math">n \approx e^{1 + W\left( \frac{1}{e} \ln \left( \frac{x}{\sqrt{2 \pi e}} \right) \right)} - \frac{1}{2}</div>

It's very precise (within 0.3) for large numbers even up to <span class="math">n = 1000[/spoiler] (I haven't checked any further).

>> No.1214415
File: 4 KB, 563x122, approx.gif [View same] [iqdb] [saucenao] [google]
1214415

>>1214404
oh, and that's the lambert W function in there. upped a bigger version

>> No.1214466

>>1214415
Actually, there's an easier formula that can also be remembered:
<div class="math">\ln n! \approx n \ln n - n</div>
It's good enough to use it in statistical physics. The absolute error diverges (veeery slowly), but the relative one converges to zero.

>> No.1214476

>>1214466
Oops, you meant the inverse faculty, nevermind

>> No.1214486

>>1214476
>>1214466
lulz

yeah I just did a clever inversion of Stirlings. this one is within 0.07 of the true n for n between 100 and 2000 at least.