erlang: refactor pandigital/1 into utils