Primes by Trial Division - IBM 5100 BASIC
18 August 2016
IBM 5100 BASIC supports only single-character variable names, and array indices are 1-based instead of 0-based. Otherwise it is the same as the Applesoft reference version.
0001 GOTO 0010 0005 C=C+1 0006 GOTO 0050 0010 DIM P(100) 0020 P(1)=2 0025 PRINT P(1) 0030 C=3 0040 FOR F=2 TO 100 0050 FOR I=1 TO (F-1) 0060 V=C/P(I) 0065 IF V=INT(V) GOTO 0005 0070 NEXT I 0080 PRINT C 0090 P(F)=C 0100 C=C+1 0110 NEXT F 0120 END