@ari462 said in How have you used different math functions in cool ways?:

local cost = (math.ceil(math.pow((Level+1) -(math.fmod((Level+1),5)),1.1)))

That's kinda similar to something like this:

```
for level = 1, 20 do
local cost = math.floor(level/4)*7
print("Level = "..level, "Cost = "..cost)
end
```

### Output:

```
Level = 1 Cost = 0
Level = 2 Cost = 0
Level = 3 Cost = 0
Level = 4 Cost = 7
Level = 5 Cost = 7
Level = 6 Cost = 7
Level = 7 Cost = 7
Level = 8 Cost = 14
Level = 9 Cost = 14
Level = 10 Cost = 14
Level = 11 Cost = 14
Level = 12 Cost = 21
Level = 13 Cost = 21
Level = 14 Cost = 21
Level = 15 Cost = 21
Level = 16 Cost = 28
Level = 17 Cost = 28
Level = 18 Cost = 28
Level = 19 Cost = 28
Level = 20 Cost = 35
```

Using your math, it's similar.

```
Level = 1 Cost = 0
Level = 2 Cost = 0
Level = 3 Cost = 0
Level = 4 Cost = 6
Level = 5 Cost = 6
Level = 6 Cost = 6
Level = 7 Cost = 6
Level = 8 Cost = 6
Level = 9 Cost = 13
Level = 10 Cost = 13
Level = 11 Cost = 13
Level = 12 Cost = 13
Level = 13 Cost = 13
Level = 14 Cost = 20
Level = 15 Cost = 20
Level = 16 Cost = 20
Level = 17 Cost = 20
Level = 18 Cost = 20
Level = 19 Cost = 27
Level = 20 Cost = 27
```

It's actually kind of the same.

Not sure if the numbers **need** to be like you made them.