mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Information & Answers (https://www.mersenneforum.org/forumdisplay.php?f=38)
-   -   The "Beautiful" Formula (https://www.mersenneforum.org/showthread.php?t=21300)

CRGreathouse 2016-05-14 04:32

[QUOTE=a1call;433870]If this code is complete and all inclusive:

[CODE]fac(n,d)=prod(k=0,(n-1)\d,n-k*d);\\Multifactorial\\Credits: http://rosettacode.org/wiki/Multifactorial#PARI.2FGP

fac(19,0)
[/CODE][/QUOTE]

I'm charmed that you'd think my code was the be-all, end-all definition of the multifactorial, but that just isn't so.

Trejack 2016-05-14 05:10

For the reciprocal of multifactorials, we have 1/(n!_x) where x is the number of exclamation marks, eg. the product of all odd numbers n!_2, or n!! would be the same to remove all factors of 2 from n!, the same as n!/(2^(n/(2(n/2)))) (I hope I got that right) or for n!_b maximum powers for n!/(b^((n/(b(n/b)))). I hope I understood what was going on.

a1call 2016-05-14 05:40

[QUOTE=CRGreathouse;433903]I'm charmed that you'd think my code was the be-all, end-all definition of the multifactorial, but that just isn't so.[/QUOTE]

Either that, or you are just too modest. I put my money on the latter.:smile:
I think the mathworld article is not likely to be explained convincingly, in any way other than a typo. Mathematics is overly B&W with hardly any gray areas.

BTW
Thank you all for the replies.

R. Gerbicz 2016-05-14 06:29

The formula was totally broken (in the first \sum you have to interchange n and k),
[CODE]
? mfac(n,k)=ret=1;forstep(i=n,1,-k,ret*=i);return(ret)
%1 = (n,k)->ret=1;forstep(i=n,1,-k,ret*=i);return(ret)
? m(n)=sum(k=0,100,1.0/mfac(k,n))
%2 = (n)->sum(k=0,100,1.0/mfac(k,n))
? m(2)
%3 = 3.0594074053425761445394754992332786127
? c=0.682689492137085897170465091264075844955825933453208781974;
? v=sqrt(exp(1))*(1+sqrt(Pi/2)*c)
%5 = 3.0594074053425761445394754992332786130
?
[/CODE]

(you can get the erf value on WolframAlpha)
m(2) and v is very close, so now it should be the good formula.

CRGreathouse 2016-05-14 19:31

[QUOTE=R. Gerbicz;433910](you can get the erf value on WolframAlpha)[/QUOTE]

GP includes erfc but not erf. You can define erf this way if you like:

[code]erf(x)=1-erfc(x)[/code]

Batalov 2016-05-14 20:01

So it seems that the confusion arose immediately from the [URL="http://mathworld.wolfram.com/ReciprocalMultifactorialConstant.html"]Wolfram page[/URL], where definition should have started with m([B]t[/B]) = ... ([B]t[/B] times)
Also, the page would have benefited from the (trivial) demonstration that m([B]1[/B]) = [I]e[/I].

[COLOR=Blue]EDIT: I'd now sent them a typo report, so the page may soon change.[/COLOR]

ewmayer 2016-05-15 07:39

[QUOTE=VBCurtis;433861]Perhaps you should read the definition of multifactorial:
[url]http://mathworld.wolfram.com/Multifactorial.html[/url]

The examples given indicate what the result is for, say, 3!!!!. So does the definition, but for some folks examples are the way to enlightenment.[/QUOTE]

Aside: I find that to be a really bad notational choice - analogously to log log n meaning log(log n), n!! should mean the obvious "factorial of factorial", that is, (n!)! .

Again by analogy with logs, a better notation for e.g. n*(n-2)*(n-4)*... would be n![sub]2[/sub].

CRGreathouse 2016-05-15 18:17

[QUOTE=ewmayer;433979]Aside: I find that to be a really bad notational choice - analogously to log log n meaning log(log n), n!! should mean the obvious "factorial of factorial", that is, (n!)! .[/QUOTE]

FWIW the designers of PARI agree: 3!! = 6! = 720, 4!! = 24! = 620448401733239439360000, etc.


All times are UTC. The time now is 23:31.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.