A SERVICE OF

logo

17–8 Miscellaneous Programs and Equations
Program Listing:
Program Lines:
(In ALG mode)
Description
&  &
This routine displays prime number P.
& #$ 
Checksum and length: AA7A 6
'  '
This routine adds 2 to P.
' 
' - 
Checksum and length: 8696 21
  
This routine stores the input value for P.
 ! 
ª

!
 
º65¸
 
 º/¸@
Tests for even input.

 !-
Increments P if input an even number.

Stores 3 in test divisor, D.
 ! 
Checksum and length: D0B8 87
%  %
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.
%  
%
º
%º65¸