Solution of an equation involving even integers

105 Views Asked by At

If $x$ is any positive even integer $> 1$. I compute:

$$ c = x + x! $$

Now assume instead $c$ (even integer) is given, and I want to get back the value $x$.

Is it possible to find a simple expression for $x$ ?

(or, if not, a convergent procedure to find it)

2

There are 2 best solutions below

6
On BEST ANSWER

From a purely algebraic point of view, assuming that the solution you looked for is large, the equation can be approximated by $$c \simeq \Gamma(x+1)$$ At this point, using Cantrell's approximation of the inverse Gamma function (refer to the link given by Robert Israel), we have $$\Gamma^{-1}(x+1) \simeq \frac{1}{2}+\frac{\log \left(\frac{x+1.03653}{\sqrt{2 \pi }}\right)}{W\left(\frac{\log \left(\frac{x+1.03653}{\sqrt{2 \pi }}\right)}{e}\right)}$$ So, we have a good starting point from which Newton iterations can start and will probably solve in a couple of iterations.

Let me consider a few examples :

  • for $c=10^2$, the approximation gives $x=4.88941$ while the exact solution of the entire equation is $x=4.86291$
  • for $c=10^4$, the approximation gives $x=7.33372$ while the exact solution of the entire equation is $x=7.33590$
  • for $c=10^8$, the approximation gives $x=11.3721$ while the exact solution of the entire equation is $x=11.3735$
  • for $c=10^{16}$, the approximation gives $x=18.1518$ while the exact solution of the entire equation is $x=18.1526$

The approximate values are slightly overestimated because I neglected the $x$ term in the equation.

Added later to this answer

For sure, you can use Newton directly; however, I should strongly recommend to solve instead $$f(x)=\log(x+x!)-\log(c)=0$$ since the logarithmic transform makes the function more "linear" or much less stiff if you prefer.

For example, let us take $c=10^{50}$ and let us be very lazy starting Newton at $x_0=1$; the successive iterates are $161.862$, $53.8383$, $41.6877$, $41.2941$, $41.2936$ which is the solution for six significant figures.

Playing a little with your equation I found a rather good approximation $$x=1.69908 \Big(\log(c)\Big)^{0.655991}$$ For the first cases looked at, the estimates of the solution are then $4.62697$, $7.29071$, $11.4880$, $18.1015$ which seem to be quite good.

1
On

The $x$ is very small compared to $x!$, so basically you want to invert the Gamma function. See e.g. this MathOverflow question