blob: 0618cf631e3634a323f4cb0d76ab12ef118717a3 [file] [log] [blame]
[SIEVE(i:1..100)::
p,mp:integer;
SIEVE(i - 1)?p;
print!p;
mp := p; comment mp is a multiple of p;
*[m:integer; SIEVE(i - 1)?m
*[m > mp mp := mp + p];
[m = mp skip
||m < mp SIEVE(i + 1)!m
] ]
||SIEVE(0)::print!2; n:integer; n := 3;
*[n < 10000 SIEVE(1)!n; n := n + 2]
||SIEVE(101)::*[n:integer;SIEVE(100)?n print!n]
||print::*[(i:0..101) n:integer; SIEVE(i)?n ...]
]