Post Reply 
(50g) Numeric List Commands
08-04-2019, 03:58 PM
Post: #4
RE: (50g) Numeric List Commands
Updating again with two more related programs.

First, the convolution inverse. This is the sequence which, when convolved with the input sequence, produces { 1 0 0 0 ... }, the identity sequence of convolution. The program assumes that you have the program from post #3 above, named DECONV, on your calculator.

Code:

\<< 1 0 PICK3 SIZE 1. - NDUPN \->LIST + SWAP DECONV
\>>


Next, the convolution square root. The "convolution square" as defined in the OEIS is the convolution of a sequence with itself. The "convolution square root" is the sequence which must be convolved with itself to produce the input sequence.

For example, the triangular numbers { 1 3 6 10 15 21 ... } convolved with themselves (using e.g. the program from post #2 above) returns { 1 6 21 56 126 252 ... }. The convolution square root of this sequence is as expected the triangular numbers.

Note that if the input list to this program is not a convolution square, the terms in the output list will not be integers. For instance, the convolution square root of the triangular numbers is { 1 '3/2' '15/8' '35/16' '315/128' '693/256' ... }.

Code:

\<< DUP HEAD \v/ OVER 2. GET OVER 2 * / 2. \->LIST 2. PICK3 SIZE 1. -
  FOR k DUP HEAD 2 * OVER TAIL DUP REVLIST * 0 + \GSLIST 4. PICK k 1. + GET SWAP - SWAP / EVAL +
  NEXT NIP
\>>

This program will run on the HP-48G if PICK3 is replaced with 3 PICK and NIP is replaced with SWAP DROP. The EVAL in the third line can also be removed.
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 - 08-04-2019 03:58 PM



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