Post Reply 
(50g) Numeric List Commands
01-29-2019, 07:13 PM (This post was last modified: 01-29-2019 07:14 PM by John Keith.)
Post: #2
RE: (50g) Numeric List Commands
Here is another list convolution program. It takes two lists (which must be the same length) and returns a list of convolutions of increasing subsets of the input lists.

The program will run on the HP48G if UNROT is replaced with ROT ROT.

The 0 + in the program is necessary because \GSLIST will error with a list size of 1.

Code:

\<< DUP SIZE \-> n
  \<< 1. n
    FOR k OVER 1. k SUB OVER 1. k SUB REVLIST * 0 + \GSLIST UNROT
    NEXT DROP2 n  \->LIST
  \>>
\>>

An example from http://oeis.org/A000330:

Code:

Input:
{ 0 1 2 3 4 5 }
{ 1 3 5 7 9 11 }

Output:
{ 0 1 5 14 30 55 }
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(50g) Numeric List Commands - John Keith - 01-16-2019, 11:24 PM
RE: (50g) Numeric List Commands - John Keith - 01-29-2019 07:13 PM



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