Least Mean Squares Algorithm confusion with Adaptive Line Enhancement
I recommend you read up on the LMS algorithm and try to understand it before you start implementing it, otherwise you won't be able to find any errors in your code. In that formula, the index $n$ is the iteration number, and the index $j$ is the vector index of the filter coefficients. So at any iteration $n$ you have $N+1$ filter coefficients (indexed by $j$) that need to be updated according to that equation.