Question: Example Page 140 User manual

Why doesnt this example work in my Maple 2021.1 from the user manual?

restart;
L := [seq(i, i = 2 .. 1000)];
divisor := 2;
while (numelems(L) > 0)  do  divisable,  L:=selectremove(i->(i mod divisor=0), L):
Error, unterminated loop

n:=numelems(divisable);  

if (n>0) then  printf("%d integers%s whose smallest prime divisor is %d\\n",n,  'if'(n>1, "s", ""), divisor):  end if;  

divisor :=nextprime(divisor);  

end do:
Error, unable to parse
 

Please Wait...