- Code: Select all
`100 PRINT "*** SIEVE OF ERATOSTHENES ***"`

120 N=100

130 DIM S(N)

140 LET P=2

150 FOR I = 1 TO N

160 S(I) = I

170 NEXT I

180 PRINT P

190 FOR J = P TO N STEP P

200 LET S(J) = 0

210 NEXT J

220 LET P = P + 1

230 IF P = N THEN GOTO 500

240 IF S(P) <> 0 THEN GOTO 180

250 GOTO 220

500 END

Next up I'm working on a multiplication program that uses the Rhind papyrus method.

- Derrik