Tesco interview question

code a function that returns the n_th element of a numerical sequence