(48G 49 50g) Stirling and Stirling-Bernoulli Transforms - 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 49 50g) Stirling and Stirling-Bernoulli Transforms (/thread-12706.html) |
(48G 49 50g) Stirling and Stirling-Bernoulli Transforms - John Keith - 03-30-2019 01:40 PM First, the Stirling transform, also known as the Stirling S2 transform. More information here and here. Code:
Next the inverse Stirling transform, also known as the Stirling S1 transform: Code:
Next, the Stirling-Bernoulli transform. While this transform is defined in terms of products of Stirling numbers and factorials, the program uses an algorithm described in this paper which is about three times as fast. Code:
Finally, the inverse Stirling-Bernoulli transform, similar to the program above. Code:
The EVAL commands inside the program arguments for DOSUBS are required because the terms of sequences returned by these programs may not be integers. All of these programs will work on the 48G as long as the I->R commands are removed. The EVAL commands and decimal points following integers can also be removed. However, the results may not be accurate for some sequences due to the 12-digit limit of the 48G. Edited 9/20/2019 to add NEWOB to both Stirling-Bernoulli transform programs. This speeds execution of the programs and allows them to process longer lists without running out of memory. |