Consider the function $f(x)=\frac{2018}{100+e^{x}}$ defined $\forall x\in\Bbb R$. How many integers are there in the range of $f$? The aforementioned question appeared in an undergraduate entrance test and hence assumes high-school level knowledge of calculus. My motivation to solve this question is this: 


*

*For $f(x)$ to assume integral values, $100+e^x\le2018$ for sure.

*Further, $e^x>0$ $\forall x\in\Bbb R$. 

*Now, $2018=2*1009$. For $e^x=909$ and $e^x=1918$(both values can be rightfully assumed, given the continuity and increasing nature of $e^x$ over $\Bbb R$), $f(x)$ equals 2 and 1, respectively. Thus, I figured that there are only two integers in the range of $f$.


My conclusion is at odds with the actual answer(there are 20 such integral values), as depicted by the graph of $f(x)$ below:

I would like answers to the following:

1.Which step(s) in my solution was/were flawed, and why?
2.Provide an analytical(non-graphical) solution to this problem(since the actual test does not permit graphing calculators).

 A: Well, it's continuous.
$0 < e^x < \infty$
$100 < 100 + e^x < \infty$
$0 < \frac 1{100+e^x} < \frac 1{100}$ and
$0 < \frac {2018}{100+e^x} < \frac {2018}{100} < 20.18$.
So there are at most the integers $1,...., 20$.  Or $20$.
And as $x\to \infty$ we get $\frac {2018}{100+e^x} \to 0$ it does get lower than $1$.
And as $x\to -\infty$ we get $\frac {2018}{100+e^x}\to 20.18$ it does get higher than $20.18$.
And as its continuous it hits every integer between $1$ and $20$.  So $20$ integer values.
======
If that's not enough:
If you want to solve $\frac {2018}{100 + e^x} =k$ for an integer $k$ then we can do
$2018 = (100+e^x)k=100k + e^x*k$
$2018 - 100k = e^x*k$
$e^x = \frac {2018-100k}k$
$x =\ln \frac {2018-100k}k$.
The requirements for this are that $k \ne 0$.  ANd that $\frac {2018-100k}k > 0$.
If $k > 0$ the we need $\frac {2018-100k}k>0 \iff 2018-100k > 0\iff k< 20.18\iff k \le 20$.
If $k < 0$ then we need $\frac {2018-100k}k > 0\iff 2018-100k < 0\iff k>20.18$ but $k < 0$ while $k > 20.18$ is impossible.
So $f(x) =k$ is possible for all $k=1,2,.....,20$.
A: I think what you actually solved is:

How many $x$ are there so that $100+e^x$ and $\frac{2018}{100+e^x}$ are both integers?

where the former restriction is not part of the question. It's better to reason that when $100+e^x$ is among the values $\frac{2018}{1},\,\frac{2018}{2},\,\frac{2018}3,\ldots,\frac{2018}{2018}$, this expression comes out to be an integer. You will see that $20$ of these are in the possible range of values of $100+e^x$ which is $(100,\infty)$. Your proof can be corrected by plugging this little fix into it.
