Lời giải :
program hotrotinhoc ;
var i,n : integer ;
function kt (n: integer) : boolean;
var i : integer ;
begin
kt:=true;
for i:= 2 to trunc(sqrt(n)) do
if n mod i=0 then kt:=false ;
end;
begin
write('Nhap do dai cua day so :'); readln(n);
for i:= 1 to n do
if kt=true then write(i,' ');
readln
end.