number of trial to obtain an outcome

Consider the independent trials each of which results in outcome $\displaystyle i, i = 0,1,...,k$ with probability $\displaystyle p_i , \sum_{i = 0}^{k} p_i = 1.$ Let $\displaystyle N$ denote the number of trials needed to obtain an outcome that is not equal to $\displaystyle 0,$ and let $\displaystyle X$ be that outcome.

(a) Find $\displaystyle P(N = n), n \geq 1.$

This is the only one that is really giving me trouble. Here is what I have:

$\displaystyle P(N = n) = \sum_{j = 0}^k P(N = n | X = j)P(X = j)$

$\displaystyle = \sum_{j = 0}^k P(N = n, X = j)$

$\displaystyle = \sum_{j = 0}^k P(N = j)...?$

(b) Find $\displaystyle P(X = j), j = 1,...,k.$

$\displaystyle P(X = j) = p_j$

(c) Show that $\displaystyle P(N = n, X = j) = P(N = n)P(X = j)$

All I need is part (a) and this becomes trivial.

Any help? Thanks.