Question: Problem with Nested loop

I am using maple 17 and I was trying to run a nested loop as shown below. I expected to get all combinations of i and j (9 components). But i and j always remain 3. What is the problem here? Can anyone suggest alternate solutions? I dont understand in which order maple increments i,j or k in each loop.

 

for k to 9 do

      for i to 3 do

          for j to 3 do

          a[k] := i, j

          end do

      end do

end do;

 

table([1=(3,3),2=(3,3),3=(3,3),4=(3,3),5=(3,3),6=(3,3),7=(3,3),9=(3,3),9=(3,3)

 

Thanks in advance

Please Wait...