I have the following sequence: $\displaystyle a_{n+1}=a_n i - p$ where i and p are constants. I need to find an equation for the sequence that is independent of the previous elements except $\displaystyle a_0$.

The Z-transform gives: $\displaystyle Z^{-1}A - Z^{-1}a_0=iA - \frac{p}{1-Z^{-1}}$ or $\displaystyle A = \frac{p}{i}\frac{1}{(1-Z^{-1})(1-i^{-1}Z^{-1})} - \frac{a_0}{i}\frac{Z^{-1}}{1-i^{-1}Z^{-1}}$.

Doing partial fractions yields: $\displaystyle A = \frac{p}{i-1}\frac{1}{1 - Z^{-1}} - \frac{p}{i(i-1)}\frac{1}{1 - i^{-1}Z^{-1}} - \frac{a_0}{i}\frac{Z^{-1}}{1-i^{-1}Z^{-1}}$

Now when I take the reverse Z-transform with $\displaystyle \frac{1}{1-i^{-1}Z^{-1}} \rightarrow i^{-n}$ gives me the wrong answer. If I substitute $\displaystyle \frac{1}{1-i^{-1}Z^{-1}} \rightarrow i^{n}$ instead, I get the correct answer. Any ideas what I've done wrongly?

P.S.

I thought I had made a mistake and it should be $\displaystyle i$ instead of $\displaystyle i^{-1}$, but I double checked everything and cannot find any mistakes. That would suggest I've probably made a mistake in the Z-transform.