For the *historical record* and in order to *preserve* my earliest and/or unreleased efforts in the wonderful world of *HP* programmable calculators and pocket computers, here you'll find a selection of **HP programs** I wrote for various *HP* models ranging in capabilities from the *HP-25* to the *HP-71B*.

The **HP-25** programs are for the most part (not all) quite simple affairs, written just for practice and never intended for release, as back in 1975 I was learning programming techniques (the *HP-25* was my very first programmable calc) and the *HP-25* was slow and had very little RAM (49 steps, 8 registers) as well as a very limited programming paradigm (no labels, no subroutines, no flags), so don't expect anything too sophisticated (though there are a few surprises). That said, I think they're still quite enjoyable and fun to check and even convert to run on other devices.

On the other hand, most subsequent *HP* models (such as the **HP-11C**, **HP-67**, **HP-34C**, **HP-41C**, etc., let alone the **HP-71B** !) had much more RAM for both programs and data and also advanced programming capabilities, so the programs I wrote for them take full advantage of that and are *significantly more complex and capable*, no longer "practice" ones. Some of them were published in the past in physical media (paper magazines, solution books, CD/DVD/USB pendrives), which would-be readers (even the authors themselves) had to *pay* for, but now for the first time they'll be available to download *for free*, as will existing but still *unpublished* programs or even ** new** programs I might write now and in the foreseeable future. Stay tuned !

- Download: HP Program VA251 - HP-25 Solving 2nd-order differential equations.pdf (576 KB)
- MD5 Checksum: ff9731692d7e54802e040dc486d81090
- Pages: 3

3-page paper featuring a 37-step RPN program for the **HP-25** to numerically solve 2nd-order differential equations of the form **y”=f(x,y)** subject to initial conditions, using the 5th-order *predictor-corrector Numerov’s method*. One worked example included.

- Download: HP Program VA252 - HP-25 Gamma Function and Factorials.pdf (668 KB)
- MD5 Checksum: cece292c3a3d619d753471ec2ec49bcc
- Pages: 2

2-page paper featuring a 49-step RPN program for the **HP-25** to accurately evaluate the **Gamma function** in the interval [1, 2], as well as approximate factorials for real-valued x. Three worked examples included.

- Download: HP Program VA341 - HP-34C Loan Amortization Schedule.pdf (394 KB)
- MD5 Checksum: 0b2c58cca514a19e255f0d03aa73eae7
- Pages: 2

2-page paper featuring a 70-step RPN program for the **HP-34C** to generate either a complete amortization schedule showing each period of a fully amortized loan or a partial schedule between two given periods. One worked example is included.

- Download: HP Program VA342 - HP-34C Summation of Alternating Series.pdf (660 KB)
- MD5 Checksum: d54d51e59f5a555a74336f3fba92e5e4
- Pages: 3

3-page paper featuring an 84-step RPN program for the **HP-34C** to quickly and accurately find the sum of infinite alternating series, even divergent ones *(Euler sum)*. Three worked examples are included.

- Download: HP Program VA343 - HP-34C Double Integrals.pdf (628 KB)
- MD5 Checksum: 3eeb8c383e68762b3e880a0fc4140df3
- Pages: 3

3-page paper featuring a 67-step RPN program for the **HP-34C** to compute the numeric value of a definite double integral of a user-specified *f(x,y)* between given limits. Four worked examples are included.

- Download: HP Program VA344 - HP-34C Solving Quartic Equations.pdf (654 KB)
- MD5 Checksum: 5821adbabe32ea718bb599aad3dc1ec6
- Pages: 4

4-page paper featuring a 175-step RPN program for the **HP-34C**, **HP-67** and **HP-97** programmable calculators to compute simultaneously and non-iteratively all four real and/or complex roots of a general 4th-degree (or less) polynomial equation with real coefficients, using exact formulas. The HP-34C's SOLVE function is not used and all four real and/or complex roots are computed at once in 15-20 seconds at most.

It will also work in the **HP-15C**, the **HP-41C** series and posibly other RPN models with very minimal changes (detailed in the *Notes*). Four worked examples are included, solving three quartics and one cubic equation.

- Download: HP Program VA345 - HP-34C Nonlinear Equations Systems.pdf (699 KB)
- MD5 Checksum: 1521895355e68574edadd1409b750d78
- Pages: 4

4-page paper featuring a 102-step RPN program for the **HP-34C** programmable calculator to solve a system of two arbitrary nonlinear equations in two variables. Will also work *as-is* in the **HP-67/97** and in the **HP-15C** and **HP-41C** series with minimal changes. Two worked examples are included.

- Download: HP Program VA346 - HP-34C Factoring-GCD-Decimal to Fraction.pdf (451 KB)
- MD5 Checksum: 9a7d6b2a2de81a1268dfdb349af3f48c
- Pages: 3

3-page paper featuring a 127-step program for the **HP-34C** programmable calculator to factorize an integer into its prime factors, compute the greatest common divisor (GCD) of two integers, and find integer fractions which best approximate a given real value. It will also work in the **HP-41C** series with trivial changes. Three worked examples are included.

- Download: HP Program VA348 - HP-34C Memory Game and Trainer.pdf (585 KB)
- MD5 Checksum: 98c7c4aa265be9818a76e609634bf226
- Pages: 3

3-page paper featuring an 86-step RPN program for the **HP-34C** to challenge your memory by testing your ability to remember what you’ve just seen and offering afterwards an accurate comment on your performance.

- Download: HP Program VA411 - HP-41C Finding Roots of Equations.pdf (619 KB)
- MD5 Checksum: 29855b819d7e9a9ac57b0d7a4b78930f
- Pages: 4

4-page paper featuring a 42-step RPN program for the **HP-41C** to find real roots of an arbitrary user-supplied equation **f(x)=0** using *Newton’s method* and a user-given initial guess. Interactive and non-interactive versions provided. Five worked examples included.

- Download: HP Program VA412 - HP-41C Finding Extrema of Functions.pdf (770 KB)
- MD5 Checksum: 9cba799e00b1de8ba6b021c28a9e2033
- Pages: 3

3-page paper featuring a 28-step RPN program for the **HP-41C** to find extrema (maxima and/or minima) of an arbitrary user-supplied function *y=f(x)* by calling program *RF (Root Finder)* internally as part of the computation. Two worked examples are included.

- Download: HP Program VA413 - HP-41C 3-point Gaussian Integration.pdf (611 KB)
- MD5 Checksum: 91abfefe8ab0cf12face481d71b5ec0d
- Pages: 3

3-page paper featuring a 55-step RPN program for the **HP-41C** to evaluate the definite integral between given limits of an arbitrary user-supplied function **f(x)** using the fast 3-point *Gauss-Legendre* quadrature formula applied over a number of subintervals. Three worked examples included.

- Download: HP Program VA414 - HP-41C Dice Rolling with Graphics.pdf (378 KB)
- MD5 Checksum: 3391e4c286fabecf6e86029b5a137122
- Pages: 3

3-page paper featuring a 90/62-step RPN program for the **HP-41C** programmable calculator series to simulate randomly throwing two dice, which are printed graphically followed by their sum.

It includes a *subroutine* which can be globally called from other programs or from the keyboard to accumulate in the printer buffer the graphics for any single die face. Both *Standard* and * Synthetic Programming* versions are included.

- Download: HP Program VA415 - HP-41C Systems of 1st-order Differential Equations.pdf (463 KB)
- MD5 Checksum: 82fecd78189f97dcc038b928c60155c9
- Pages: 7

7-page paper featuring a 137-step program for the **HP-41C** programmable calculator to obtain quickly and accurately an approximate numerical solution for a system of N simultaneous first-order differential equations or, conversely, a single differential equation of the Nth-order, using a fourth-order Runge-Kutta method. It will also run in the **HP-41CV**, **HP-41CX** and the **HP42S**. Two worked examples included.

- Download: HP Program VA416 - HP-41C Mate w King Bishop Knight Practice.pdf (671 KB)
- MD5 Checksum: 2df91f7046ab45942dbd082d09504335
- Pages: 7

7-page, 13-diagram paper featuring a 285-step program for the **HP-41C** programmable calculator (will also run *as-is* in the **HP-41CV** or the **HP-41CX** and with trivial changes in the **HP42S** as well as in compatible devices or emulators). The program is intended to help the user practice in order to achieve the difficult basic checkmate of *King*, *Bishop* and *Knight* (controlled by the user) vs. *King* alone (controlled by the program) within a specified number of moves. The user must try and checkmate before the allotted moves elapse while the program does its best to avoid being checkmated.

Two worked examples included, one of them against the world-class chess engine *Stockfish 9* (released in 2018 and rated at more than 3,300 ELO), the other against a human user.

- Download: HP Program VA417 - HP-41C Systems of Linear Equations - Gauss-Seidel.pdf (627 KB)
- MD5 Checksum: 8de9c5639f51ea0fe4464c71e3b50dcd
- Pages: 4

4-page paper featuring a 129-step RPN program for the **HP-41C** programmable calculator (will also run *as-is* in the **HP-41CV/CX** and in the **HP42S** with trivial changes) to obtain a numerical solution for a system of N algebraic linear equations in N unknowns using the iterative method of *Gauss-Seidel*, a *relaxation/overrelaxation* method.

A system of up to 15 equations can be solved if using all 4 memory modules (HP-41C) and the input matrix is left *unchanged* by the procedure so it can be reused for further processing. Also, full details are given to modify it to use *synthetic instructions* to save registers, if desired. Two worked examples included.

- Download: HP Program VA418 - HP-41C Memory Game and Trainer.pdf (505 KB)
- MD5 Checksum: 46ee2647d25ddaf0b5afd8828007bfec
- Pages: 3

3-page paper featuring a 142-step fun game RPN program for the **HP-41C** to challenge your memory by testing your ability to remember what you’ve just seen and offering afterwards an accurate comment on your performance.

- Download: HP Program VA419 - HP-41C ESP Tester.pdf (521 KB)
- MD5 Checksum: c1954afd5e757b042c5e4eb8a3f139f9
- Pages: 2

2-page paper featuring an 85-step fun RPN program for the **HP-41C** to test your *“ESP” (Extra-Sensorial Powers)* by conducting a series of 10 tests, after which it reports the % of success and an evaluation of your alleged extrasensorial abilities (if any). One sample run included.

- Download: HP Program VA420 - HP-41C Eigenvalues of Symmetric Matrices - Jacobi.pdf (640 KB)
- MD5 Checksum: 35a7c4632f5e53d95703e82948ab0405
- Pages: 5

5-page paper featuring a 215-step RPN program for the **HP-41C** programmable calculator (will also run *as-is* in the **HP-41CV/CX** and in the **HP42S** with trivial changes) to find all eigenvalues of a real symmetric NxN matrix using the iterative method of *Jacobi*, which is fast and always converges.

Matrices up to 22x22 can be treated and full details are given about the algorithm and on how to modify the program to use *synthetic instructions* to save registers, if desired. One worked example and two test cases with solutions included.

- Download: HP Program VA421 - HP-41C NxN Matrix Inversion.pdf (618 KB)
- MD5 Checksum: 563487a7a93462374ed71ca126149ebd
- Pages: 4

4-page paper featuring a 170-step RPN program I wrote in 1980 for the **HP-41C** programmable calculator (will also run as-is in the **HP-41CV/CX**) to compute the inverse of a real NxN matrix (no *Advantage* module back then), where N ranges from 1 up to 16, using a non-gaussian interchange method.

The program is written so that zero pivots will cause no trouble, they’re skipped and the following pivot is tested. The locations of all zero pivots are remembered and their corresponding interchanges are performed later.

- Download: HP Program VA710 - HP-71B Producing Digits of Pi one at a time.pdf (563 KB)
- MD5 Checksum: 37b1e88a71ef7aef24b3cd7a30eccd57
- Pages: 3

- 3-page paper featuring a
*proof-of-concept*BASIC program written in 1996 for the**HP-71B**pocket computer to produce an arbitrary number of digits of Pi__one at a time__using a so-called*spigot*algorithm. A sample run computing 1,000 digits of Pi is given.

- Download: HP Program VA711 - HP-71B Exact Integer Determinants and Permanents.pdf (536 KB)
- MD5 Checksum: 8ae38895e5d225ee290e01e88aa9ebda
- Pages: 3

- 3-page paper featuring a 5-line BASIC subprogram for the
**HP-71B**to evaluate determinants and permanents for real or complex NxN matrices. Unlike other methods where floating-point divisions are involved, if the elements are moderately-sized integers the integer results will be exact, even for singular or very ill-conditioned matrices. Two worked examples are included.

- Download: HP Program VA712 - HP-71B Multiprecision E and its roots.pdf (458 KB)
- MD5 Checksum: b464c3f9fea91308ea68a0314a1c1c84
- Pages: 3

- 3-page paper featuring a 5-line BASIC program I wrote in 1990 for the
**HP-71B**which can quickly compute up to 35,500 digits of Euler’s constant e and its roots (square root, cubic root, etc.). Five worked examples are included.

- Download: HP Program VA713 - HP-71B Packing Long Integers.pdf (302 KB)
- MD5 Checksum: 323be1a64db7bdaef2f8dbf284158089
- Pages: 3

- 3-page paper featuring a small assembly-language LEX file written in 1991 for the
**HP-71B**pocket computer to pack long integers in the range from 0 to 16,777,215 into 3-character strings and, conversely, to unpack a 3-character string into the equivalent long integer value.

These articles, programs, pictures, their descriptions and other materials created by me are (c) Valentin Albillo, and can be used freely for non-profit purposes as long as (1) the contents aren't modified in any way and (2) the copyright is acknowledged.

In plain words, you can download them and use them for non-profit purposes but do not include them in any media and/or site for which you're asking money, do not tamper with their contents and do not say or imply that you created them or that you don't know who created them, you must always give due credit to the copyright holder (that's me).