This, if I did it right:
var i, k, N: Integer; {n->i}
x, Y: array of Double; {X->Y}
begin
SetLength(Y, N);
for k:=0 to N-1 do
begin
Y[k]:=0;
for i:=0 to N-1 do
Y[k]:=Y[k]+x[i]*cos(pi*k*(i+0.5)/N)
end;
end;
Note that Pascal is not case sensitive, so you cannot have "x" and "X" or "n" and "N" in one formula. Therefore, I used "i" instead of "n" and "Y" instead of "X".
Also, you need to initialize count N and array x.