PRIME NUMBERS for Sinclair ZX-80
by Jack Bettridge
from Your Computer, April 1982

ANY PRIME NUMBER up to the arithmetical maximum of 32,767 can be identified
with this program, which works fast if the computer is not asked to digest
too many numbers at one time.

If there are hundreds of numbers between A and B, the screen will remain
blank for some seconds and the Continue key may be subsequently needed to
obtains additional pages.

Lines 90 to 140 are required just in case 1, 2, and 3 are included in the A
to B range. Anyone willing to ignore the technicality that these first
three numbers are primes can save six lines of program. It is obviously a
waste of time counting any even number after 2, so lines 150 and 220 ensure
only odd numbers are considered. Each odd number within the range is
progressively divided and repeatedly tested for a remainder or zero by
lines 180 to 210. Line 250 is necessary because the ZX-80 has no Step
facility.

[The program as listed contains two bugs. An additional line '145 LET A=C'
is required. Line 200 should test 'P=0' and not 'P=Q' as shown.]
