Basically, Erlang doesn't allow loops, only recursion, which is fine for regular functions, since you can just use the function's name. However, anonymous functions inherently do not have a name, and as a result the only way to do loops is to whip out your textbook on Lambda Calculus, and copy Haskell Curry's way of doing recursion.
It works fine, but it's also really hard to read, and not fun. Erlang 17 allowed you to give a temporary name to the lambda, which you could use for recursion.