function round100(n)
return math.floor(n*100)/100
end
function round3(n)
return math.floor(n/3)*3
end
local signs = {
"K",
"M",
"B",
"T",
"Qd",
"Qn",
"Sx",
"Sp",
"Oc",
"No",
"De",
"UDe",
"DDe",
"TDe",
"QdDe",
"QnDe",
"SxDe",
"SpDe"
}
function shorten(n)
if n >= 1000 then
local num = round100(n/10^round100(round3(math.floor(math.log10(n)))))
if signs[round3(math.floor(math.log10(n)))/3] then
local sign = signs[round3(math.floor(math.log10(n)))/3]
return num..sign
else
return n
end
else
return n
end
end
local num = io.read()
local cost = 10
for i = 1, (num-1) do
cost = cost + (math.sqrt(cost)*(math.sqrt(cost)/(math.log10(cost)*3.25)))
end
print(shorten(cost))
To embed this project on your website, copy the following code and paste it into your website's HTML: