Program Listing:

Program Lines:

 

Description

(In ALG mode)

 

 

&  &

This routine displays prime number P.

& #$ 

 

 

Checksum and length: AA7A

6

'  '

This routine adds 2 to P.

' 

 

 

' - 

 

 

Checksum and length: 8696

21

    !  ª  !    º65¸    º/¸@    !-     ! 

This routine stores the input value for P.

Tests for even input.

Increments P if input an even number. Stores 3 in test divisor, D.

Checksum and length: D0B8 87

%  % %   % ª %  % º/@ % ! ' %   %  º % º65¸

This routine tests P to see if it is prime.

Finds the fractional part of P D.

Tests for a remainder of zero (not prime).

If the number is not prime, tries next possibility.

17–8Miscellaneous Programs and Equations

Page 290
Image 290
HP 33s Scientific manual 17-8Miscellaneous Programs and Equations,  #$ ,   ,