you cant modify constants, thus them being called constants, but supposing X,Y and Z were variables, then I believe you'd do something like this:
for i in 0...$game_actors.size
X_OUTPUT[i] = (Z * i) + X
Y_OUTPUT[i] = (Z * i) + Y
X_OUTPUT[i] and Y_OUTPUT[i] are arrays so you can store each iteration, you could change it to a regular variable if you didn't need the values for all the iterations.