General recursive solution for one dimensional quantum potentials