Eratoszthenész szitája:
program sieve2;
var
prime : array[0..32767] of boolean;
n, index : integer;
begin
{$A-}
{$O-}
poke(#38, chr(#c9));
for n := 1 to 32767 do
prime[n] := true;
for n := 1 to 127 do begin
if prime[n] then begin
index := 2 * (n * n + n);
repeat
prime[index] := false;
index := index + n + n + 1;
until (hi(index) > chr(#7f));
end;
end;
poke(#0328, chr(120));
poke(#05be, chr(#18));
poke(#05e7, chr(#18));
write(chr(27),'S', 2 : 8);
for n := 1 to 32767 do
if prime[n] then write(n + n + 1 : 8);
writeln;
poke(#0328, chr(121));
poke(#05be, chr(#28));
poke(#05e7, chr(#28));
poke(#38, chr(#f5));
end.