I am making a code in which a sum of the initial number stays in a certain range without exceeding 10000, neither of them two, one is the sum of the first +123, but for some reason, 2500 results (customers) do not come out, they only come out 2459
The initial number is 5000, and at no time can it exceed 10,000, the operation consists of X and X+123, but I have only achieved 2439 results
What error occurs?
clientes = 2500
base = 5000
sumport = 124
portase = {}
for i=1, clientes do
str = "no"
--formula = math.floor(base+((i*sumport)/53)) --2000 clients
formula = 5000+( ( math.floor( i / 123 ) ) * ( 123 ) ) + (i-1) --New formule
portase[formula+123] = true
ASE = formula+123
if ASE > 10000 then
break
end
if portase[formula] then
str = "YES YES YES YES"
end
ASE = formula+123
print ("CLIENT: "..i..", PORT: "..formula..", ASE: "..ASE..", MATCHES WITH OTHER? "..str)
portase[formula] = true
end