Here are three ways to iterate from 2 t a b c d for i v in ipairs t do if i 1 then print i v end end for i 2 t do print i t i end for i 2 1e6 do where 1e6 1 million is larger than needed if not t i then break end print i t i end For a strange order use another table t a b c d color red for v in ipairs 3 color 4 2 do TABprint t v end By the way I use the following for accummulating results local function collection TAB Return a table to hold items TABreturn TABTABn 0 TABTABadd function self item TABTABTABself n self n 1 TABTABTABself self n item TABTABend TABTABjoin function self sep TABTABTABreturn table concat self sep TABTABend TAB end local function work TABlocal results collection TABfor i 1 5 do TABTABresults add i i TABend TABreturn results join n end local s work this is a string of 5 lines