Does not happen here (Mathematica 10.0.1, Windows 7 Home Premium 64 Bit)
In[18]:= Clear[n, a, k, e, f]
n = 4;
a = Partition[RandomSample[Range[n^2]], n];
k = a; Print[a];
Print[MatrixForm[a]]; e = ToString[Column[a]];
f = StringReplace[e, {"{" .. -> "(", "}" .. -> "),"}];
Print[f];
Print[a];
Print[k]
{{13,7,15,1},{11,5,9,14},{10,3,16,2},{8,6,4,12}}
(13 7 15 1
11 5 9 14
10 3 16 2
8 6 4 12
)
(13, 7, 15, 1),
(11, 5, 9, 14),
(10, 3, 16, 2),
(8, 6, 4, 12),
{{13,7,15,1},{11,5,9,14},{10,3,16,2},{8,6,4,12}}
{{13,7,15,1},{11,5,9,14},{10,3,16,2},{8,6,4,12}}
In[21]:= Print[k]
{{13,7,15,1},{11,5,9,14},{10,3,16,2},{8,6,4,12}}
In[22]:= Print[a]
{{13,7,15,1},{11,5,9,14},{10,3,16,2},{8,6,4,12}}
looks like the a
gets re-evaluated to hold a new RandomSample
.
How the input sequence number propagates depends strictly on your typing habits to give new lines or not
In[32]:= n = 4; n = 5; n = 6; (* one input 32, return *)
In[33]:= n (* one input 33, return *)
Out[33]= 6
In[34]:= n = 4; (* one input 34, new line *)
n = 5; (* one input 35, new line *)
n = 6; (* one input 36, return *)
In[37]:= n (* one input 37 *)
Out[37]= 6
Try please to quit the mathematica kernel and start with a new session - from somewhere a re-evaluation of a slipped in in your example.