# Question c9d66

Jan 6, 2017

$11$

#### Explanation:

We need the maximum $n$ such that

(n+1)!-1 le 10^9 or

(n+1)! le 10^9+1. We will try to obtain a reasonable firts approximation for $n$.

Applying $\log$ to both sides

log((n+1)!) le log(10^9+1) or

${\sum}_{k = 0}^{n} \log \left(k + 1\right) \le \log \left({10}^{9} + 1\right)$ or

${\int}_{0}^{n} \log \left(\xi + 1\right) d \xi = \left(n + 1\right) \log \left(n + 1\right) - n \le \log \left({10}^{9} + 1\right)$

Now using an iterative procedure like Newton

${x}_{k + 1} = {x}_{k} - {f}_{k} / {\left(\frac{\mathrm{df}}{\mathrm{dx}}\right)}_{k}$ with

$f \left(x\right) = \left(x + 1\right) \log \left(x + 1\right) - x - \log \left({10}^{9} + 1\right)$

we obtain in few iterations the value for $n$

$n = \left\lfloor 11.75 \right\rfloor = 11$ so with $n = 11$ we have

(11+1)!-1 = 479001599 lt 10^9 and

(12+1)!-1=6227020799 gt 10^9#