# Recursively Defined Sequence/Examples/Minimum over k of Maximum of 1 plus Function of k and 2 plus Function of n-k

## Theorem

Consider the integer sequence $\left\langle{f \left({n}\right)}\right\rangle$ defined recusrively as:

$f \left({n}\right) = \begin{cases} 0 & : n = 1 \\ \displaystyle \min_{0 \mathop < k \mathop < n} \max \left({1 + f \left({k}\right), 2 + f \left({n - k}\right)}\right) & : n > 1 \end{cases}$

$f \left({n}\right)$ has a closed-form expression:

$f \left({n}\right) = m$ for $F_m < n \le F_{m + 1}$

where $F_m$ denotes the $m$th Fibonacci number.

## Proof

The proof proceeds by induction.

For all $n \in \Z_{\ge 1}$, let $P \left({n}\right)$ be the proposition:

$f \left({n}\right) = m$ for $F_m < n \le F_{m + 1}$

### Basis for the Induction

$P \left({1}\right)$ is the case:

 $\displaystyle 0$ $=$ $\displaystyle$ $\displaystyle F_0$ $<$ $\, \displaystyle 1 \,$ $\, \displaystyle \le\,$ $\displaystyle F_{0 + 1}$ $\displaystyle$ $=$ $\displaystyle 1$ Definition of Fibonacci Number: $F_1 = 1$ $\displaystyle \leadsto \ \$ $\displaystyle m$ $=$ $\displaystyle 0$

Thus $P \left({1}\right)$ is seen to hold.

This is the basis for the induction.

### Induction Hypothesis

Now it needs to be shown that, if $P \left({r}\right)$ is true, where $r \ge 1$, then it logically follows that $P \left({r + 1}\right)$ is true.

So this is the induction hypothesis:

$f \left({r}\right) = m$ for $F_m < r \le F_{m + 1}$

from which it is to be shown that:

$f \left({r + 1}\right) = m$ for $F_m < {r + 1} \le F_{m + 1}$

### Induction Step

This is the induction step:

 $\displaystyle$ $=$ $\displaystyle$ $\displaystyle \leadsto \ \$ $\displaystyle$ $=$ $\displaystyle$

So $P \left({r}\right) \implies P \left({r + 1}\right)$ and the result follows by the Principle of Mathematical Induction.

Therefore:

$\forall n \in \Z_{\ge 1}: f \left({n}\right) = m$ for $F_m < n \le F_{m + 1}$

$\blacksquare$