(48G,50g) ConvOffs Transform - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (48G,50g) ConvOffs Transform (/thread-12514.html) |
(48G,50g) ConvOffs Transform - John Keith - 02-27-2019 02:22 PM These strangely named integer transforms are generalizations of the method used to create Pascal's triangle and similar number triangles. More information in this thread. The first program takes a list of integers and returns the transformed list, which will be one term longer than the input list. Updated 1/20/2020 with a shorter and faster version using DOLIST. Code:
For example, given the input list { 1 2 3 4 5 } the program will return row 5 of Pascal's triangle. The next program implements the ConvOffsStoT transform. It calls the program above. This program is basically the same but returns a list of lists which are transforms of sublists of the input list. Given a list of length n, the program will return lists of length 1 through n+1. Code:
As an example, with an input list of { 1 2 3 4 5 } the program will return the first 6 rows (rows 0 through 5) of Pascals triangle. |