Post Reply 
HP 50g Double factorial
01-28-2024, 08:48 PM (This post was last modified: 01-28-2024 10:22 PM by John Keith.)
Post: #26
RE: HP 50g Double factorial
(01-27-2024 09:33 PM)DavidM Wrote:  

John Keith's example covers most everything you could want here, and is much more efficient. I just wanted to point out the use of LWHL and LPROD in this context, which shortens the code significantly. As is frequently the case, though, large lists take lots of memory and can be slow to process.

Another nice use for ListExt is to produce lists of double factorials. The following program will return a list of the first n odd double factorials (A001147) given n on the stack. Changing the first 1 into a 2 will return the even double factorials (A000165) instead. The second 1 can be removed if the 0th term is not required.

Code:

\<< 1 2 ROT LASEQ 1 :: * LSCAN
\>>
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP 50g Double factorial - joeres - 05-01-2019, 11:19 AM
RE: HP 50g Double factorial - Gilles - 05-01-2019, 01:40 PM
RE: HP 50g Double factorial - joeres - 05-01-2019, 03:57 PM
RE: HP 50g Double factorial - Gilles - 05-01-2019, 04:14 PM
RE: HP 50g Double factorial - joeres - 05-01-2019, 06:01 PM
RE: HP 50g Double factorial - John Keith - 05-01-2019, 07:00 PM
RE: HP 50g Double factorial - joeres - 05-02-2019, 08:33 PM
RE: HP 50g Double factorial - grsbanks - 05-01-2019, 04:59 PM
RE: HP 50g Double factorial - Gilles - 05-01-2019, 07:06 PM
RE: HP 50g Double factorial - Albert Chan - 05-01-2019, 06:17 PM
RE: HP 50g Double factorial - joeres - 05-01-2019, 06:26 PM
RE: HP 50g Double factorial - joeres - 05-02-2019, 09:34 PM
RE: HP 50g Double factorial - joeres - 05-01-2019, 06:35 PM
RE: HP 50g Double factorial - FLISZT - 01-27-2024, 05:57 AM
RE: HP 50g Double factorial - DavidM - 01-27-2024, 01:50 PM
RE: HP 50g Double factorial - FLISZT - 01-27-2024, 05:51 PM
RE: HP 50g Double factorial - DavidM - 01-27-2024, 09:33 PM
RE: HP 50g Double factorial - FLISZT - 01-28-2024, 01:47 AM
RE: HP 50g Double factorial - DavidM - 01-28-2024, 02:51 PM
RE: HP 50g Double factorial - FLISZT - 01-28-2024, 07:07 PM
RE: HP 50g Double factorial - John Keith - 01-28-2024 08:48 PM



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