# [Python 2], <s>39</s> 38 bytes

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

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

[Try it online!][TIO-js5zyurb]

[Python 2]: https://docs.python.org/2/
[TIO-js5zyurb]: https://tio.run/##Vc3RCoMwDAXQ935FYQwVlTWN7VDYv9jh3IQtSvFlL/v1rlZ03YVAyOGS6T0/RpLO9ZeneV07w6khbqjjffop6aSzvC3pqHNoR5skrh8tH/hA3Bq631IotMgaxic70OwrQ1awsDO2nZQQGfc5@FFaqh3O6geVQtgBxFpZACvEHWqU9QbgIyNBEQvEApvokL8/S2sl1NGnQN4CAYJEdF8 "Python 2 – Try It Online"

 Outputs 1-indexed number