Const
maxn = 100;
type
myarr = array [1..maxn] of longint;
var
a: myarr;
i, n, k7, kotr: longint;
begin
writeln('Введите количество элементов массива:');
readln(n);
for i := 1 to n do begin
a[i] := random(100); //i * i div a[i - 1];
if (a[i] mod 7 = 0) then
inc(k7);
if (a[i] < 0) then
inc(kotr);
end;
write(a[i], ' ');
for i := 3 to 5 do
a[i] := a[i + 1];
a[5] := 99;
for i := 1 to n do
writeln(a[i]);
end.
И где, собственно, формула?