Okay, assuming you have some idea on the atomic spectrum of Hydrogen,
1λ=R.[1n22−1n21]
is how you determine the wavelength of the photon emitted, where R is the Rydbergs constant and n2 is final shell, n1 is the initial shell
To find the photon with maximum energy, you have to find a photon with the least value of λ which is same as having most value of 1λ so you need to find values of n2,n1 such that
1n22−1n21 is minimum as R is just a constant,
To do this we need least value of n2 and max value of n1
And for shells the values range from 1 to infinity,
Hence value of n2= 1, n1= infinity
So the electron must go from infinity to 1st shell
This is essentially the same as the atom capturing a free, i.e unbounded electron that then transitions to the first shell.