I have a warning using the construction x -> f(x, i) where i is the
parameter of a loop. It seems that G.A.P. builds a function with two
parameters x, i and says "i undefined global variable" (it's only a
warning).

GAP emits a warning if the body of a function (in this example the body
is 'RemInt(x,3) = i') contains reference to a global variable (in this
example 'i'), which at the time the function is *read* does not have an
assigned value. And since the entire loop is read before iterating
starts, you get the warning. To suppress the warning, simply assign a
value to 'i'.