We assume that $\lambda$ is a real distinct from 1 and we set $w = \frac{1}{\lambda - 1}$. We denote $\log_2$ the logarithm function in base 2. For $n \geq 1$, we set $S_k(n) = \sum_{m=2}^{n} D_k(m)$. Deduce from the previous question that
$$\chi_n(\lambda) = (\lambda - 1)^n - \sum_{k=1}^{\lfloor \log_2 n \rfloor} (\lambda - 1)^{n-k-1} S_k(n).$$