while (i <= 1000) {
e.Result = a;
backgroundWorker1.ReportProgress(i);
}
will allow you to pass the current index in your while loop to an appropriate event handler.
You have to create an handler for the ProgressChanged event to be catched:
backgroundWorker1.ReportProgress += backgroundWorker1_ProgressChanged;
private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
int index = e.ProgressPercentage;
}