Solution (source code)

= Solution

The right-hand side of the <slow-roll curvature power spectrum> must be evaluated separately for each mode at <cosmological horizon exit>, $k=aH$. Taking logarithms gives
$$
\log\Delta_{\mathcal R}^2=2\log H-\log\epsilon+\text{constant}.
$$
For $N=\log a$,
$$
\frac{d\log H}{dN}=-\epsilon,
\qquad
\frac{d\log\epsilon}{dN}=\eta,
\qquad
\frac{d\log k}{dN}=1-\epsilon.
$$
Hence
$$
n_s-1
=\frac{-2\epsilon-\eta}{1-\epsilon}
=\boxed{-2\epsilon-\eta+O(\epsilon^2,\epsilon\eta)}.
$$
This is the <scalar spectral index in Hubble slow-roll parameters>.