Erlang N-dimensional Index Iterator