In a for loop you have to use a local variable that you create in the first part of the loop. you cannot use a variable created somewhere else.
if you want to use vars created somewhere else use a while loop.
while(i < n)
{
textBox2.Text += " " + Convert.ToString(i);
i++;
}