title: Looping over specific values in PARI/GP
body: <p>I have a large collection of vectors, each of the form <code>[a,b,c,d]</code>.</p>
  <p>For each vector, I want to return the result <code>[a,b,c,d,a+b^2+c^3+d^4]</code>. What would be the best way of doing this?</p>
  <p>For example, say my vectors are <code>V = [ [1,2,3,4], [5,6,7,8], [9, 10, 11, 12] ]</code>. Would the best way to do this be defining a function such as:</p>
  <p><code>test( W ) = for( i=1, #W, print( [ [W[i][1],W[i][2],W[i][3],W[i][4],W[i][1]+W[i][2]^2+W[i][3]^3+W[i][4]^4] ] ) )</code> ?</p>
  <p>(Keeping in mind that in practice I will also have a larger collection of vectors)</p>
  <p>This feels like a naive way of doing this, so is there a better way? In particular, is this the quickest way? Is there a better way to store my collection of vectors?</p>