# Solving recurrence relation using Mathematica defined in a piecewise way

I have a recurrence relation defined as following:

RSolve[
{
p == p0,
p == λ p/μ,
p[i + 1] == λ p[i]/(2 μ)
},
p[i], i
]


Note that the relation is differently for i=1, than for i >= 1. This yields the following error:

DSolve::bvnul: For some branches of the general solution, the given boundary conditions lead to an empty solution. >>

When I use Piecewise, Mathematica just echos the input:

RSolve[
{
p[i + 1] ==
Piecewise[{
{p0, i == -1},
{λ p[i]/μ, i == 0},
{λ p[i]/(2 μ), i >= 1}}]
},
p[i], i
]


Also using If or Condition does not to work out.

(Btw, this simple example can easily be solved by hand, but I would like to solve more complicated recursions involving piecewise definitions.)

This works:

RSolve[{
p == l p0/m,
p[n + 1] == l /(2 m) p[n]},
p[n], n]
(*
-> {{p[n] -> 2^(1 - n) (l/m)^n p0}}
*)


(The overspecification of p and p is not to the taste of RSolve)

Another way:

k = k0;
k = l k/m;
k[i_] := l k[i - 1]/(2 m) /; i > 1;
FindSequenceFunction[Table[k[i], {i, 1, 10}], n]
(*
-> 2^(1 - n) k0 (l/m)^n
*)


Edit

Reader, beware! As of v8.0, RSolve and FindSequenceFunction are both immature implementations (I think), and there a lot of cases where the output is just the input.