@Kitonum
In case that I have more than one list the "do" loop does not seem to work:
L[1]:=[x1,x2,x3,x4]:
L[2]:=[y1,y2,y3,y4]
......
for j from 1 to 2 do
K[j]:=(i::integer) -> `if`(irem(i,4)<>0, L[j][irem(i,4)], L[j][4]);
od;
Any idea to make this procedure working for any L[i]?