I am trying to learn how to solve difference equations in order to derive intertemporal budget constraints. Consider the government's flow budget constraint:
$$\frac{B_{t}-B_{t-1}}{p_{t}} + \frac{M_{t}-M_{t-1}}{p_{t}} + s_{t} -i_{t-1}\frac{B_{t-1}}{p_{t}} = 0$$
where $s_{t}$ is real taxes net of government consumption. I re-write the above as
$$\frac{R_{t}B_{t-1} + M_{t-1}}{p_{t}} = \frac{B_{t} + M_{t}}{p_{t}} + s_{t}$$
where $R_{t}$ is the gross nominal interest rate.
Now I am quite lost. I think what is confusing me is that I have $t-1$ and $t$ terms on the left-hand side. The examples I have tried before are usually on the form $a_{t} = a_{t+1} + b_{t} +(...)$ which I then solve "forward" by substituting for $a_{t+1}$ over and over again until I see a pattern developing. But in this case I can't really re-write the LHS in a proper manner.
Any thoughts on how I should proceed? And if there are any books that go through difference equations I would be very interested in some names as I am self teaching myself so far.
EDIT: Thanks to @luchonacho I have obtained the following:
$B_{t} = \frac{B_{t+T}}{R_{t+1}R_{t+2}...R_{t+T}} + \frac{D_{t+T}}{R_{t+1}R_{t+2}...R_{t+T}} ...\frac{D_{t+1}}{R_{t+1}}$ since we are in an inifite period world I write this as"
$B_{t} = \lim_{T\to\infty} \frac{B_{t+T}}{R_{t+1}R_{t+2}...R_{t+T}} + \sum\limits_{j=1}^{\infty} \frac{D_{t+j}}{\prod_{s=1}^{j} R_{t+s}}$
I might have messed up the summation/product notation but this is one of the expressions I have seen for the intertemporal constraint. However, another common way I have seen it written is as follows:
Ignore the right-hand side as it assumes a functional form of the utility function. I am interested in obtaining an expression with both $B_{t-1}$ and $M_{t-1}$ on the LHS. Is there a way I can go from the expression I obtained above to the one with both $B_{t-1}, M_{t-1}$? I am interested in deriving this because I want an expression for the valuation of all government liabilities.