An electron confined to a one-dimensional box has energy levels given by the equation En=n2h2/8mL2 where n is a quantum number with possible values of 1,2,3,…;m is the mass of the particle; and L is the length of the box.
Ok so here it's pretty simple, we are just calculating the energies of electrons for different levels (ns) and we already have an equation for that!
En = (n^2 x h^2)/(8 x m x L^2)
Here we are just plugging in 1, 2 or 3 for n.
h is plank's constant and it equals to 6.626 x10^-34 (kg x m^2)/s
m is mass of the electron in kg, which is 9.109x 10^-31 kg
L is length in meters, so here you would convert 310 pm to m. Remember 1pm = 10^-12 m
Good luck with studying!