Solution (source code)

= Solution

Let $G(z)=\sum_{n\ge0}p_nz^n$ be the <probability generating function>. For $|z|<1$ the series can be differentiated term by term: $\sum n p_n|z|^{n-1}$ is finite, even without a finite claim-count <expected value>. Multiply the <Panjer claim-count class> recurrence by $n$ and put $m=n-1$. Then
$$
G'(z)=\sum_{n\ge1}np_nz^{n-1}=\sum_{m\ge0}\{a(m+1)+b\}p_mz^m=azG'(z)+(a+b)G(z).
$$
Hence
$$
\boxed{(1-az)G'(z)=(a+b)G(z).}
$$
This argument is valid throughout the open unit disk. Values at boundary points may be obtained by a limit when the required derivatives exist; one need not assume $\mathbb EN<\infty$ to establish the identity.