base_n function

Base N conversion