Back to index

Prime Number Factorisation for the HP-42S

By Erik Ehrling (Sweden). Any comments or suggestions are very welcome!

This program returns the prime number factorisation of an integer.


Enter any integer < 99 999 999 and run FCTR. Depending on the size of the smallest factor the running time can be anything from a few seconds to a few minutes.When the factorisation is finished the result will be displayed in the upper area of the display and can also be found in the alpha register.

Note that the stack, all numbered registers and user flags are left unaltered by the program. It is therefore possible to run FCTR in the middle of a calculation and then continue after it has run.



Technical notes:
Binary files for emulators:

State-file for Emu42: fctr.e42 Raw binary: fctr.raw  Binary for HP-42X: fctr.42x

Program listing: