Suppose you have a list of items. The end items cost 1 dollar each. The items next to the ends cost 2 dollars each and the items next to those (towards the middle) cost 3 dollars each and so on. Hence the most expensive item(s) are the one(s) in the middle. The total number of items in the list is n. How do I determine the total cost of the items in the list? It seems like there should be 2 different equations: one for when n is even and one for when n is odd. This is meant to be a middle school challenge problem so I assume it does not use summation notation. I would appreciate any help.
I got 0.25n^2 + 0.5n as the equation for even n and 0.25n^2 + 0.5n + 0.25 for odd n by doing plug and check and excel plotting but what is the mathematical way to arrive at that?
We can use summation notation to express our answer should we desire
Using cases of either having $n$ be even or odd,
$$2\sum_{i=1}^{0.5n} i$$ if $n$ is even, or
$$2\sum_{i=1}^{0.5(n-1)}(i) + \lceil n/2 \rceil$$ if $n$ is odd
Where $\lceil n \rceil$ is the ceiling function