In the hydrogen atom, the energy of the electron in a given energy level is given by : #E_n= -R_H*(Z/n)^2#

#E_f= -R_H*(Z/n_f)^2#

#E_i= -R_H*(Z/n_i)^2#

#DeltaE=E_f-E_i #

#DeltaE=[-R_H*(Z/n_f)^2]-[ -R_H*(Z/n_i)^2] #

take # -R_H*(Z)^2# as a common factor,

#DeltaE=-R_H*(Z)^2[1/n_f^2-1/n_i^2] " (Eq. 1)"#

The energy of the photon emitted is given by:

#DeltaE=-hc/lambda " (Eq. 2)"#

please note that a negative sign must be introduced to the energy expression since energy is released.

combining the two equations (Eq. 1 and Eq.2) gives:

#-hc/lambda=-R_H*(Z)^2[1/n_f^2-1/n_i^2] " (Eq. 3)"#

#h" is Planck's constant" = 6.626*10^-34 J.s #

#R_H" is Rydberg constant" = 2.178*10^-18 J #

#Z" is the atomic number of the hydrogen atom" = 1#

#n" is principle quantum number"#

#n_i =?" "# is the initial quantum state of the electron.

#n_f =2 " "# since the wavelength emitted lies in the visible region of the spectrum ( Balmer series). All visible transitions must end up with #n= 2#.

plugging the numbers in #"(Eq.3)"#

#-(6.626*10^-34 J.sxx2.998*10^8 m/s) /(656.7xx10^-9 m)=-2.178*10^-18 J*(1)^2[1/2^2-1/n_i^2] #

#-(6.626*10^-34 cancel(J).cancel(s)xx2.998*10^8cancel(m)/cancel(s)) /(656.7xx10^-9 cancel(m))=-2.178*10^-18 cancel(J)*(1)^2[1/2^2-1/n_i^2] #

solve for #n_i#,

#n_i= 3#