The Rydberg formula (for the hydrogen atom) is usually given as
$\tilde{\nu}=\frac{1}{\lambda} = \mathrm{R}\Big(\frac{1}{n_f^2}-\frac{1}{n_i^2}\Big)$$$\tilde{\nu} = \frac{1}{\lambda} = R \left( \frac{1}{n_\mathrm f^2}-\frac{1}{n_\mathrm i^2} \right)$$
$\mathrm{R}$ Here, $R$ is the Rydberg constant; take care otof the unit ($\mathrm{m^{-1}}$$\mathbf{m^{-1}}$ or $\mathrm{cm^{-1}}$$\mathbf{cm^{-1}}$) here! Wikipedia quotes a value of $\pu{1.097 \times 10^7 m-1}$ for a nucleus of infinite mass. In principle, the value for a nucleus of finite mass (as is the case here) is slightly different, but for the purposes of this question, we can ignore that.
${n_f}$$n_\mathrm f$ is the final state, and ${n_i}$$n_\mathrm i$ is the initial state.
So, if you substitute $R = \pu{1.097 \times 10^7 m-1}$, $n_\mathrm{f} = 2$, $n_\mathrm i = 5$, you can arrive at $$\tilde\nu = \pu{2.304 \times 10^6 m-1}$$
and the wavelength is $\lambda = 1/\tilde\nu = \pu{4.341 \times 10^-7 m}$, or if you convert to nanometers, $\lambda = \pu{434.1 nm}$. Double-checking against the Wikipedia page on the Balmer series, this value is indeed correct.