John Keith

First Name:John
Last Name:Keith
Last Change:2023-05-14
Number of Files:50 (16th most prolific)
Number of Downloads:8,989 (1,107th most downloaded)

Base Conversion Programs   (details) 49/50 48 ENG   4KB/1KB
Two simple programs convert integers to and from lists of digits in any base. The integers, the base and the digits may be positive or negative.
By John Keith. 2023/05/14

Bell Numbers   (details) 49/50 ENG   3KB/1KB
A program that returns a list of the Bell numbers (OEIS A000110) and one that returns row 0 through n of the Bell triangle (OEIS A011971), both of which require GoferLists, along with a separate program that returns the nth Bell number.
By John Keith and Gerald Hillier. 2020/04/12

Bernoulli, Euler and Bessel Polynomials   (details) 49/50 ENG   4KB/1KB
Computes the values of the Bernoulli polynomials, Euler polynomials and reverse Bessel polynomials. Given an integer n on level 2 and a number x on level 1, the program BERPOLY returns the value of the nth Bernoulli polynomial at x. The program EUPOLY similarly computes the value of the nth Euler polynomial at x. The program BESSEL similarly returns the value of the nth reverse Bessel polynomial at x. Requires ListExt.
By John Keith. 2021/12/31

Binomial Transform, Difference Table   (details) 49/50 48 ENG   3KB/1KB
Difference tables and the binomial transform are powerful methods for analyzing integer sequences and their underlying logic. See also Conway and Guy, "The Book of Numbers", chapter 3. Difference tables can be easily created using the \GDLIST (Delta-LIST) command on many HP calculators. This directory contains a program to return a difference table as a list of lists, the inverse binomial transform of a list, and the binomial transform of a list. Also has a program to do OEIS A000292.
By John Keith. 2019/05/27

Boustrophedon Transform   (details) 49/50 ENG   3KB/1KB
Implements the boustrophedon transform for a list of integers (both 48 and 49), OEIS A000111 and the triangle associated with the transformed sequence, OEIS A008280 (49 only). Requires GoferLists.
By John Keith. 2021/09/12

Catalan Transforms, Hankel Transform   (details) 49/50 ENG   3KB/1KB
Some useful transforms for integer sequences, with the Catalan transform, inverse Catalan transform, ballot transform, inverse ballot transform, and Hankel transform.
By John Keith. 2019/12/29

Chebyshev U Polynomials   (details) 49/50 ENG   2KB/1KB
Returns the value of the nth Chebyshev U polynomial at x. Note that the built-in function TCHEBYCHEFF returns the nth Chebyshev T polynomial. Chebyshev T polynomials are also known as Chebyshev polynomials of the first kind, and the U polynomials as Chebyshev polynomials of the second kind.
By John Keith. 2020/06/06

Closest Standard-Resistor Values   (details) 49/50 48 ENG   7KB/2-4KB
A set of programs by two different authors to give a standard resistor value (in the E24, E48, E96, or E192 series) closest to the desired resistance.
By John Keith and David Bengtson. 2020/10/06

Conversion To and From Base i-1   (details) 49/50 48 ENG   5KB/2KB
Several pairs of programs to do conversion between positive, negative, and Gaussian integers of different bases, including complex numbers.
By John Keith. 2023/05/14

Convert Integer Base   (details) 49/50 ENG   5KB/1KB
Converts an integer from one integer base to another. Also has a version that works with reals, a version that works with negative numbers, and a version written in System RPL.
By Gerald Hillier and John Keith. 2023/05/14

ConvOffs Transform   (details) 49/50 48 ENG   3KB/1KB
Generalizations of the method used to create Pascal's triangle and similar number triangles, containing two programs. The first program takes a list of integers and returns the transformed list, which will be one term longer than the input list. 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.
By John Keith. 2020/04/11

Delannoy Numbers   (details) 49/50 48 ENG   3KB/1KB
Delannoy numbers have many applications in combinatorics and number theory. Fortunately they are fast and easy to compute. These programs return a rectangular array of Delannoy numbers, the Delannoy triangle (also known as the tribonacci triangle), and the central Delannoy numbers. The first one requires GoferLists and only runs on the 49/50; the latter two also run on the 48.
By John Keith. 2019/06/17

Digits Sum   (details) 49/50 ENG   4KB/1KB
Calculates the sum of the digits of an integer. Includes two User RPL versions, one System RPL version, and one assembly language version.
By Juan, John Keith, Gerald Hillier and others. 2023/05/14

Divisibility Programs   (details) 49/50 ENG   3KB/1KB
Several short programs for number theory functions related to prime factors and divisibility. I am posting them as a directory object for convenience and because of some dependencies. Some short descriptions follow, in order of the listings: JorJ2 is the Jordan J2 function. DDKPSI is the Dedekind Psi function. LVL\Gl is the Liouville lambda function. Requires Factor, ListExt, and Möbius Function.
By John Keith. 2021/04/10

Eta Quotients   (details) 49/50 ENG   2KB/1KB
Computes sequences known as "multiplicative eta quotients"
By John Keith. 2019/09/11

Euler Transform   (details) 49/50 ENG   2KB/1KB
Contains programs for computing the Euler transform and its inverse for sequences of integers. Both require the ListExt library.
By John Keith. 2019/08/29

EXP, LOG and Multinomial Transforms   (details) 49/50 ENG   3KB/1KB
Computes the EXP (exponential), LOG (logarithmic), MNL (multinomial) and IML (inverse multinomial) transforms of number sequences. Definitions and examples can be found at A274804, A274805, A274760 and A274844. Requires GoferLists and ListExt.
By John Keith. 2019/12/29

Falling and Rising Factorials   (details) 49/50 ENG   3KB/1KB
Several programs for computing values of falling and rising factorials. Provided as a directory object for convenience but there are no inter-dependencies between the programs, so unused programs can be removed without affecting the others. Most of the programs require the ListExt library.
By John Keith. 2021/05/23

Farey Sequence   (details) 49/50 ENG   2KB/1KB
Creates the Farey sequence of order n, returning a list of two lists, the numerators and denominators of the sequence. These are row n of A006842 and A006843 respectively. Requires ListExt.
By John Keith. 2020/05/03

Fast Pascal's Triangle   (details) 49/50 ENG   3KB/1KB
Quickly generates any row of Pascal's Triangle. Also includes a program to calculate rows of the Narayana triangle, too. Requires ListExt.
By John Keith. 2021/12/31

Fractional Base Conversions   (details) 49/50 48 ENG   3KB/1KB
Set of programs that convert between integers and numbers in fractional base. The program I->FBL expects an integer n on level 3, the numerator p on level 2 and the denominator q on level 1. The program returns a list of integers representing the digits of n in base p/q, in standard order (units on the right, highest powers on the left). For example, if the level 3 argument is 15, level 2 is 3 and level 1 is 2, the result is { 2 1 0 1 0}, the digits of 15 in base 3/2.
By John Keith. 2023/05/14

Gaussian Binomial Triangles and Transforms   (details) 49/50 ENG   4KB/2KB
A group of programs to compute the Gaussian binomial coefficients and the q-Stirling numbers, which are closely related. Some of the programs require ListExt.
By John Keith. 2021/04/10

Gegenbauer and Jacobi Polynomials   (details) 49/50 ENG   3KB/1KB
Three programs to compute the values of the Gegenbauer polynomials C(n, a, x), renormalized Gegenbauer polynomials C(n, x) and Jacobi polynomials P(n, a, b, x) at x. The Jacobi polynomials are a generalization of the Gegenbauer polynomials, which in turn are generalizations of Chebyshev and Legendre polynomials.
By John Keith. 2022/02/27

Gray Codes   (details) 49/50 48 ENG   2KB/1KB
Returns a list of binary Gray codes from 0 to 2^n-1. For example, given the number 4 the program will return a list of Gray codes from 0 to 15.
By John Keith. 2021/05/23

Invert Transform   (details) 49/50 48 ENG   2KB/1KB
Two routines, for the invert transform and its inverse. Does OEIS A158943 and OEIS A155728.
By John Keith. 2019/04/22

Laguerre Polynomials   (details) 49/50 ENG   3KB/1KB
Returns the value of the nth Laguerre polynomial L_n(x) at x. To use the program, n (which must be an integer) should be on level 2, and x should be on level 1. If x is an integer, the result will be an integer or a rational number. Includes a regular version and a shorter/faster version that is dependent upon ListExt and GoferLists.
By John Keith. 2020/04/11

Lambert W Function   (details) 49/50 48 ENG   17KB/1KB
Computes the Lambert W function W(z) for branches 0 and -1. For branch -1, the program covers the real-valued range -1/e < z < 0. For branch 0, the program covers the entire complex plane. For most values, the results are accurate to within 2 ULPs. For values very close to 1/e, the results are approximate. The program expects the branch (0 or -1) on level 2 and z on level 1.
By John Keith. 2023/05/14

Lerch Transcendent and Polylogarithm   (details) 49/50 48 ENG   2KB/1KB
This program computes the Lerch transcendent Phi(z, s, a). The arguments may be real or complex. The program is a straightforward implementation of the function definition and it converges fairly quickly if |z| is not close to 1. The execution time rises and accuracy decreases as |z| approaches 1, so this is not an efficient algorithm for the Zeta function. The number 9999 for the maximum number of iterations may be lowered to improve speed at the cost of accuracy for values of |z| close to 1.
By John Keith. 2021/11/24

Logic Operations for Large Integers   (details) 49/50 ENG   3KB/1KB
Programs to make it easier to perform logic operations on large integers, such as one to pad an integer string with leading zeros and one to invert the significant bits of a number without regard to word size. Requires ListExt.
By John Keith. 2022/08/28

Matrix Permanent   (details) 49/50 48 ENG   5KB/1KB
Computes the permanent of a square matrix. The matrix may be real or complex, and on the 49 and 50, may also be exact integer or symbolic (type 29).
By John Keith. 2023/05/14

Moebius Transforms   (details) 49/50 ENG   3KB/1KB
Four Moebius transform related programs. They are most useful for integer sequences related to the divisor function, the Moebius Mu function, and the Euler Phi function. Requires ListExt.
By John Keith. 2021/11/24

Narayana Transform   (details) 49/50 ENG   2KB/1KB
Computes the Narayana transform of a list of integers. The Narayana transform is a variation of the binomial transform.
By John Keith. 2020/04/11

Necklace Programs   (details) 49/50 ENG   3KB/2KB
A group of programs that compute functions related to necklaces and bracelets (number theory, not jewelry!). The following sequences are covered: A000011, A000013, A000016, A000029, A000031, A000046, A000048, A001037, A059053, A059076, A179781, A308706. Requires GoferLists and Möbius Function.
By John Keith. 2019/07/20

Normal Distribution Functions   (details) 49/50 ENG   3KB/1KB
Simple programs for working with normal distributions, for calculating the lower-tail normal CDF, the normal PDF Z(x), normally distributed random numbers, and an array of normally distributed complex numbers.
By John Keith. 2018/12/21

Number of Trailing Zeros in N!   (details) 49/50 ENG   6KB/1KB
Returns the number of trailing zeros in n!. Requires ListExt to work with numbers over 100 digits. This is OEIS A027868.
By John Keith. 2022/08/07

Numeric List Commands   (details) 49/50 48 ENG   4KB/1KB
Implementations of some commands from the Wolfram Language, including a command to generate a list of integers based on the linear recurrence of the integer sequence, and two commands to perform convolution of lists, one of which takes a list and a kernel, and the other which takes two lists, plus a command for deconvolution, plus commands for the convolution inverse and convolution square root. Requires ListExt for the first two programs; only the last two run on the 48 as well.
By John Keith. 2019/08/29

OEIS A035327   (details) 49/50 ENG   2KB/1KB
For integer input N > -1 this returns the Nth element in the sequence OEIS A035327. Includes two approaches at the problem, one of which requires ListExt.
By Gerald Hillier and John Keith. 2019/12/31

OEIS A111138   (details) 49/50 38 Prime ENG   5KB/1KB
Returns the Nth element of the series OEIS A111138.
By Gerald Hillier and John Keith. 2019/07/20

Outer Product and Kronecker Product   (details) 49/50 ENG   2KB/1KB
Two programs, one which computes the outer product of two vectors or the Kronecker product of two matrices, and the other which computes the "generalized outer product" of two vectors.
By John Keith. 2019/02/23

Partition Numbers   (details) 49/50 ENG   3KB/1KB
Given an integer n on the stack, these two programs return a list of the partition numbers (A000041) from 0 through n. The first program is small, and the second one is fast. Also has a third program that returns the partition number triangle (A008284) as a list of lists. It is large (214 bytes) but fast, as it takes advantage of many patterns that occur in the triangle.
By John Keith. 2019/08/29

Ramanujan Tau Function   (details) 49/50 ENG   4KB/1KB
Set of three User RPL programs to compute the Ramanujan tau function (A000594) for positive integers. Requires Sum of Divisors to an Integer Power and ListExt. Also includes a standalone program written in System RPL.
By John Keith and Gerald Hillier. 2018/12/21

Relatives of Bernoulli Numbers   (details) 49/50 ENG   3KB/1KB
A collection of three programs which compute Poly-Bernoulli numbers, Genocchi numbers and Gregory coefficients, numbers related to Bernoulli numbers. Requires ListExt.
By John Keith. 2022/08/07

Removing Objects From Lists Quickly   (details) 49/50 ENG   2KB/1KB
Shows how to remove objects from lists or remove duplicates from lists quickly, with the help of GoferLists, ListExt, and LSort.
By John Keith. 2019/02/27

Self-convolutive Sequences   (details) 49/50 ENG   3KB/1KB
Generates a vast number of integer sequences, many relating to graph theory, combinatorics and theoretical physics. For a list of named sequences, see the CROSSREFS section of A172455.
By John Keith. 2020/04/11

Shoelace Algorithm   (details) 49/50 ENG   5KB/1KB
A program that uses the shoelace method for calculating the area of a polygon (3 different versions, including one that runs on both the 48 and 49) and another version that also calculates the area and centroid (barycenter) of a polygon (for the 49 only). Also calculates the perimeter of a polygon.
By John Keith and Thomas Klemm and others. 2019/08/29

Stirling and Stirling-Bernoulli Transforms   (details) 49/50 48 ENG   3KB/1KB
Routines to do the Stirling transform (S2), the inverse Stirling transform (S1), the Stirling-Bernoulli transform, and the inverse Stirling-Bernoulli transform.
By John Keith. 2019/04/02

Tables from the Book of Soyga   (details) 49/50 ENG   5KB/2KB
The Book of Soyga (also known as Aldaraia) is a 16th century treatise on magic, astrology and mysticism by author(s) unknown. The last section of the book consists of 36 tables each of which is a 36 by 36 grid of letters. The tables can be produced by a deterministic algorithm; see A346223. This implements the algorithm used to produce the tables, in the form of a numerical array as in the OEIS link, or as a printable grid of letters. Requires ListExt.
By John Keith. 2021/07/30

Triangular Matrix Utilities   (details) 49/50 ENG   4KB/1KB
Utility programs to convert between matrices and number triangles. The number triangles are in the form of lists of lists. Requires ListExt.
By John Keith. 2021/04/10

Weigh   (details) 49/50 ENG   2KB/1KB
Computes the WEIGH transform of a sequence of integers. Some information here. Must be run in exact mode. Requires ListExt.
By John Keith. 2020/01/22

Zigzag Numbers   (details) 49/50 ENG   2KB/1KB
Set of two programs for zigzag numbers. One returns a list of the zigzag numbers (A000111) from 0 though n. The even-indexed terms (starting with 0) of the list are the unsigned Euler numbers, also known as secant numbers (AA000364). The odd-indexed terms (starting with 1) are the tangent numbers, AA000182. The other returns rows 0 through n of AA008281, the triangle from which the zigzag numbers are derived. Requires GoferLists.
By John Keith. 2018/10/14

Part of the HP Calculator Archive,
Copyright 1997-2023 Eric Rechlin.