The Museum of HP Calculators


RPRIMES for the HP-50G

This program is by Eddie Shore and is used here by permission.

This program is supplied without representation or warranty of any kind. Eddie Shore and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.

Overview

Returns the number of relative primes of integer N as list. Useful in number theory and abstract algebra.

Listing

<< -> n
<< { } -> t 
<< 1 n 1 - 
FOR I
IF n I GCD 1 ==
THEN I t + 't' STO
END NEXT t SORT  >> >> >>

Go back to the software library
Go back to the main exhibit hall