# Tag Info

The reason you end up in an infinite loop is that you are reusing i as iteration variable. After executing vectorBasis[perm], arrayToVec has set i to $2$. Therefore, every time the condition i <= Length[vectorBasis[perm]] is checked, i is reset to $2$, and the condition will always be satisfied. An easy fix would be to make i in arrayToVec a local ...