Following up on the bug report aspect of this thread, it looks like every 32nd time through the loop, the first statement in the loop is executed twice. If I make that statement a NOP, the results are correct.
let Z=""
let n=6 //first number of the array
loop
nop
Z=Z+","+n
n=n+1
stoploopif n=100
endloop
Z=Z[2,-1] // gets rid of the leading comma