Suppose that $x_0$ is given and $$ x_n=\frac{Kx_{n-1}}{x_{n-1}+(K-x_{n-1})e^{-r}}+M,\qquad\text{ for }n\geq1 $$ where $K$, $r$, and $M$ are real constants. How can I find a general formula for $x_n$?
Context
Suppose that the initial population of a country is $x_0$, then the population of the country at time $t$, where $t$ is in years, is given by the logistic model
$$ x=\frac{Kx_0}{x_0+(K-x_0)e^{-rt}} $$ The logistic model does not include the immigration to the country. If we assume that on average $M$ people immigrate to the country each year, then how can we modify the logistic model so that it includes immigration to the country as well?
The standard logistic growth model in discrete time is
$$N_{t+1}=N_t+rN_t\left(1-\frac{N_t}{K}\right)$$
where $N_t$ is the population at time $t$, $r$ is the natural growth rate, and $K$ is the carrying capacity.
To add immigration of amount $M$ each period just write:
$$N_{t+1}=N_t+rN_t\left(1-\frac{N_t}{K}\right)+M$$
However there is no closed form solution to this.
The standard logistic growth model in continuous time is
$$\frac{dN}{dt}=rN\left(1-\frac{N}{K}\right).$$
This has a nice closed form solution:
$$N(t)=\frac{K}{1+\left(\frac{K}{N_0}-1\right)e^{-rt}}$$
With constant immigration rate $M$ you would have
$$\frac{dN}{dt}=rN\left(1-\frac{N}{K}\right)+M$$
This has a closed form solution similar to the standard logistic growth model. You can find the solution in this paper here (as well as an extension to a stochastic model):
http://dx.doi.org/10.1016/j.tpb.2003.08.003