I asked this question on MSE, but didn't get enough information. If it is a violation of some norms, let me know, I'll delete it.

I'm having problem solving this difference equation. Initially I thought it should be quite easy to solve using generating functions (e.g. like in Migdal(2010), Woodbury(1949) or Gani(2006), but have made no progress so far.

The intuition behind it is that each iteration population either increases by 1 species (with probability $p(x)$ or stays the same w.p. $q(x)$, so $A(n,x)$ can be seen as the expected size of the population at iteration $n$.

It seems pretty straightforward, but I couldn't move along. I know the solution involves Casoratian and finding some product $\Pi_{x=1}^{m}p(x)$, but apart form that I couldn'd do much.

Also, if it happens to be some well-known problem, please don't solve it for me, just point in the right direction