I wrote this code:
n = 8;
U = RandomSample[Range[0, n-2]];
V = Table[{Sin[2π k/(n-1)], Cos[2π k/(n-1)]}, {h, 0, n-2}, {k, -h, n-2-h}];
W = V /. Thread[V[[1]] -> U];
The code does exactly what I expect. On the other hand, I would like to get W directly from U, without passing through V, for example using Mod[]. Can you help me? Thanks.