(50g) Delannoy numbers
|
06-02-2019, 11:34 PM
(This post was last modified: 06-02-2019 11:38 PM by John Keith.)
Post: #1
|
|||
|
|||
(50g) Delannoy numbers
Delannoy numbers have many applications in combinatorics and number theory. Fortunately they are fast and easy to compute. Further details here.
The following program returns a rectangular array of Delannoy numbers. Given two integers referred to as m and n in the linked article, the program will return an array of m columns and n rows. The program actually returns a list of lists, and may be followed by AXL if a matrix is desired. The program requires the GoferLists library. Code:
The next program returns the Delannoy triangle, also known as the tribonacci triangle. The numbers are the same as in the array but arranged in a triangle. Given an integer n, the program returns rows 0 through n of the triangle as a list of lists. Code:
Finally, a program that computes the central Delannoy numbers which are the central column of the triangle and the main diagonal of the array. Given an integer n the program returns terms 0 through n of the sequence. Code:
The last two programs will run on the HP-48G but are of limited usefulness since the numbers involved grow rapidly beyond 12 digits. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(50g) Delannoy numbers - John Keith - 06-02-2019 11:34 PM
RE: (50g) Delannoy numbers - Luigi Vampa - 06-03-2019, 06:52 PM
|
User(s) browsing this thread: 1 Guest(s)