local file = io.open("listOfCombinations.txt","a") file:write("List of Combinations") for a = 0, 65 do fooa = (1.15^a)-1 for b = 0, 52 do foob = fooa+((20/3)*((1.15^b)-1)) if foob < 10000 then for c = 0, 40 do fooc = foob + ((100/3)*((1.15^c)-1)) if fooc < 10000 then for d = 0, 28 do food = fooc + ((200)*((1.15^d)-1)) if food < 10000 then for e = 0, 19 do fooe = food + ((2000/3)*((1.15^e)-1)) if fooe < 10000 then for f = 0, 11 do foof = fooe + ((8000/3)*((1.15^f)-1)) if foof < 10000 then for g = 0, 4 do foog = foof + ((40000/3)*((1.15^g)-1)) if foog < 10000 then file:write("\n"..a..", "..b..", "..c..", "..d..", "..e..", "..f..", "..g) end end end end end end end end end end end end end file:close()