Try a solution of the form x(k) = A t^k + Bk . You find that At^k +Bk = pAt^{k+1} + pB(k+1) + (1-p)At^{k-1} + (1-p)B(k-1) + 1. Collecting terms, At^{k-1}(t - pt^2 - (1-p)) = pB - (1-p)B + 1. Since the two sides are independent, they must both be zero. This gives a quadratic equation for t, with roots t_1 and t_2, and an equation for B, so that the general solution is A_1t_1^k + A_2t_2^k + Bk, where B is now fixed and A_1 and A_2 are determined by the end conditions. If p=1/2 the equation for t has a repeated root and you introduce a trial solution of the form (A+Ck)t^k + Bk.