This question refers to an extension of Add list of vectors to list of vectors recursively . I tried hard to complete the problem but now I got stuck. I have vectors
lis0 = {u, v}
m = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
Adding each component of m
to lis0
gives me
lis1={{{u, v}, {1 + u, v}}, {{u, v}, {u, 1 + v}}, {{u, v}, {-1 + u, v}}, {{u, v}, {u, -1 + v}}}
Now I want to add each vector of m
to each last component of lis1
resulting in 16 sublists
lis2={{{{u, v}, {1 + u, v}, {2 + u, v}}, {{u, v}, {1 + u, v}, {1 + u, 1 + v}},{{u, v}, {1 + u, v}, {u, v}}...
So now I want to continue adding m
to each last element in lis2
and so on. Lists will grow exponentially in size. Here is my code so far:
lis1 = {u, v} + # & /@ m;
lis1 = List[lis0, #] & /@ lis1
x2 = Map[Function[z, z + # & /@ m], Last /@ lis1]
here x2
is part of next lis2