J.R. S. answered 02/10/22
Ph.D. University Professor with 10+ years Tutoring Experience
Let me preface this by stating I am unfamiliar with the term "as a function of K" in this regard as I don't know what K is. So, I've given an approach based on what I understand about excitation of an electron in a hydrogen atom.
∆E = RH (1/nf2 - 1/ni2)
RH = -2.179x10-18 J
nf = final energy level = 9
ni = initial energy level = 3
∆E = -2.179x10-18 J (1/81 - 1/9)
∆E = -2.179x10-18 J (-0.0988)
∆E = 2.15x10-19 J = 2.15x10-22 kJ

J.R. S.
02/10/22
Kamryn D.
When it says 3rd and 9th excited state does it mean n=4 and n=10?02/10/22