Program FindPrime; Const per=50000; size=1000000-per-1; need=6600; outf='D:\primelst.out'; Var pri :Array[0..need] of Word; i, total :LongInt; Procedure initial(Var pri:Array of Word; Var total:LongInt); Var i, j :Longint; chk :Array[1..per] of boolean; Begin fillchar(chk, sizeof(chk), true); For i:=2 to trunc(Sqrt(per))+1 do If chk[i] then Begin j:=i+i; While j<=per do Begin chk[j]:=false; Inc(j, i); End; pri[total]:=i; Inc(total); End; For i:=trunc(Sqrt(per))+2 to per do If chk[i] then Begin pri[total]:=i; Inc(total); End; End; Procedure AreaFind(vsta :LongInt; pri:Array of Word; Var total :LongInt); Var i, k, hh :Word; chk :Array[1..per] of boolean; Begin i:=0; hh:=Trunc(sqrt(vsta+per))+1; fillchar(chk, sizeof(chk), true); While pri[i]<=hh do begin k:=pri[i] - vsta mod pri[i]; While k<=per do begin chk[k]:=false; Inc(k, pri[i]); End; Inc(i); End; For k:=1 to per do If chk[k] then Begin Write((k+vsta):10); Inc(total); If total mod 10=9 then writeln; End; End; Begin Assign(output,outf); Rewrite(output); fillchar(pri,sizeof(pri),0); Initial(pri, total); i:=0; While pri[i]