Based on your comments, I assume this is something like what you want to do, where t is the table that you mentioned.
for i = 1, 6 do
local k = 'mainMenuButtonGroup' .. i
t[k]:removeSelf()
t[k] = nil
end
String concatenation is performed by the .. double period operator, and table indexing via . or []. In this case, you're indexing via [] because you're using a variable and not a constant name.
Edit: Put your similar local variables into a table instead. It makes it far, far easier to iterate as a group. In fact, the only way I know of to iterate locals is through the debug library.
local mainMenuButtonGroup = { {1,2}, {3,4}, {5,6}, {7,8}, {9,10} }
table.insert(mainMenuButtonGroup, {11,12})
for i = 1, 6 do
mainMenuButtonGroup[i] = nil
end
Note, however, that setting a numeric index in a table to nil does not rearrange the table's numerically indexed values. I.e., you'll leave the table with holes. See table.remove.