.


1 - 3


while i <= trunc(sqrt(p)) do

begin

if p mod i = 0 then

k := k + 1;

i := i + 2

end;

if k = 0 then

write(p, ' ')

end

end;

{----------------------------------------------------------------------------------------}

begin

write(' > 1 '); readln(n);

write(' '); readln(m);

writeln(' [', n, ' ', m, ']');

for i := n to m do

probleme_number(i);

writeln

end.

4. . (1588 - 1648) ,

2p

- 1,

p

. . , .

, :

-, , ;

-, , ( ).

:

Procedure Probleme_number(p : longint; var

v : longint);

var

i, k : longint;

begin

if p = 2 then v := p

else if p mod 2 <> 0

then

begin

i := 3; k := 0;

while i <= trunc(sqrt(p)) do

begin

if p mod i = 0 then

k := k + 1;

i := i + 2

end;

if k = 0 then v := p