## 2070.82 – Mystery Function

First of all, $f(1) = 2$. Then, further values of $f$ are given by $f(n) = f(n-1) + n.$

Under these circumstances, which of these formulas gives $f(n)$?

(a) $n+1$, (b) $(n+1)^2$, (c) $\frac{n^2 +n + 2}{2}$, (d) $\frac{(n+1)^2}{2}$, (e) $\frac{(3n-1)^2}{2}$.

Solution

Of course we can just plug the first few integers into the five given formulas and see which works, but here is a more subtle way.

We start by calculating some values:

\begin{aligned} f(1) &=& 2, && \\ f(2) &=& 2 + 2 &=& 4, \\ f(3) &=& 4 + 3 &=& 7, \\ f(4) &=& 7 + 4 &=& 11, \\ f(5) &=& 11 + 5 &=& 16. \end{aligned}

With each step we are adding one more number so $f$ should be something like $f(n) \approx 1 + 2 +3 \ldots + n$. Let's calculate this sum:

\begin{aligned} 1, && \\ 1 + 2 &=& 3, \\ 1 + 2 + 3 &=& 6, \\ 1 + 2 + 3 + 4 &=& 10, \\ 1 + 2 + 3 + 4 + 5 &=& 15. \\ \end{aligned}

So, we see that

$f(n) = (1 + 2 + \ldots + n) + 1 = \frac{n(n+1)}{2} + 1 = \frac{n^2 + n + 2}{2}.$

The correct answer is (c). (That formula for the sum of the first n whole numbers is a handy one to know.)

For inquiring minds: what if $f(1)$ isn't $2$? What if $f(1)$ is, say, $3$? or $f(1) = n$?