Post Reply 
Double factorial
03-02-2015, 05:15 PM
Post: #4
RE: Double factorial
(03-02-2015 04:18 PM)Han Wrote:  The wiki explains how you can calculate it using the regular factorial:
...
It should be pretty easy to write your own program using these formulas. (Note: the wiki has a slight error ...

(03-02-2015 04:36 PM)Helge Gabert Wrote:  No error checking, but something along these lines

#cas
...
Is this what you are asking (simple program)?

yes, thanks both!
so this should be enough "precise" and it is ok both in Home and CAS:
Code:

EXPORT factorial(n)
//Double factorial n!!
BEGIN
local f;
IF odd(n) THEN f:=product(X,X,,1,n,2);
ELSE f:=product(X,X,2,n,2); END;
RETURN(f);
END;

My memory failed, and I didn't remember "product()" Smile

thanks again,
Salvo

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Double factorial - salvomic - 03-02-2015, 01:49 PM
RE: Double factorial - Han - 03-02-2015, 04:18 PM
RE: Double factorial - Helge Gabert - 03-02-2015, 04:36 PM
RE: Double factorial - salvomic - 03-02-2015 05:15 PM
RE: Double factorial - Gerald H - 03-02-2015, 05:30 PM
RE: Double factorial - salvomic - 03-02-2015, 05:32 PM
RE: Double factorial - DrD - 03-03-2015, 12:02 PM
RE: Double factorial - salvomic - 03-03-2015, 01:24 PM



User(s) browsing this thread: 1 Guest(s)