INT tot
INT n
INT j
INT te
IN INT tot numero massimo
SET n 1
:scn
SET j 2
OUT $n$\n
:sieve
MOD n j te
#OUT \n- $te$ -\n
JME scr j n
INC j 1
JM sieve te 0
INC n
JLE scn n tot
END
:scr
#OUT $j$ sas\n
JMP sieve