Solution (source code)

= Solution
{c}

With independent <Bernoulli trials> of success probability $p$, $N$ counts the failures before the first success. There are $n$ failures followed by one success with probability $(1-p)^np$, giving the stated <geometric distribution> on $\{0,1,2,\ldots\}$. It counts failures, rather than the total number of trials including the success.