Exercise 2.5. Formula for the pattern
In this exercise, you will derive a formula that gives the number of steps required by the search algorithm in terms of the position of the target. To do this, simply add the entries in the bottom row of the table from Exercise 2.4 and use algebra to simplify the expression obtained.
Write the formula here: