Prime Number Generator

A simple prime number generator, using the sieve of Erastothenes algorithm (complexity n log n). The implementation was originally written for my RC2014 and translated into Sharp BASIC in early 2021 – thanks, pandemic!

This means that unlike the RC2014 version, it is limited to scanning the first 255 whole numbers for primes due to the maximum length of an array allowed in SP-5025 BASIC. I’m currently putting together a version that will overcome this limitation.

Lines 1-200
Lines 200-1000
Program output

If you’d like to run some of the programs I’ve archived on your own MZ-80K or emulator, you can find them in my Sharp MZ-80K github repository.