A learning algorithm for multilayered neural networks based on linear least squares problems