# [Python 2], 39 bytes

<!-- language-all: lang-python -->

    f=lambda n:n and f(~-n/6)+`6-~-n%6`or''

[Try it online!][TIO-js5yyeeb]

[Python 2]: https://docs.python.org/2/
[TIO-js5yyeeb]: https://tio.run/##Vc1hC4IwEAbg7/sVgwiTlHY7t1Dov7gwa1CnDL/0pb@@5kRbLxwc9/By43t6DCS97y9P87p2hlND3FDH@8OnpJPOj60uw7bX7eCyzPeD45Zb4s7Q/XaAQou8YXx0lqbQsXnB4s7YelJC5DxkF0ZpqTY4qx9UCmEDEEtlBqwQN6hR1itAiEwERSqQCqyiY/7@zK2FUCefIgWLBAgS0X8B "Python 2 – Try It Online"

Outputs 1-indexed number