EasyManua.ls Logo

HP HP-32S - Page 240

HP HP-32S
312 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
X14
GTO
X Branchesto test the potential prime with the
new
factor.
Bytes
and
Checksum: 021.0, 43F2
Flags
Used:
None.
Memory Required: 50.5 bytes: 34.5 for program, 16 for variables.
Program
Instructions:
1. Key in the program routines; press
[c]
when done.
2. Key in an
odd
integer.
3. Press I
XEQ
IP to start program. The prime number, P, will be
displayed.
4. To see
the
next prime number, press IR/SI.
Variables
Used:
P Prime value
and
potential prime values.
D Divisor which is being used to test the current value of P.
Remarks:
No tests are made to assure
that
the
input
is an odd, posi
tive integer greater
than
3.
Example.
What is the first prime number after 789? What is the next
prime number?
Keys:
789rxEQ|P
R/S
Display:
P=797.0000
P=809.0000
238
14:
Miscellaneous
Programs
Description:
Keys in 789
and
starts
program; displays first
prime number.
Calculates
the
next
prime number after
797.

Table of Contents

Related product manuals