Post History
Python 3, 78 bytes def t(n,*l):d="0+-"[n%3];return d*(not l or n*n) if n*n<2 else t((n+1)//3,1)+d Try it online!
Answer
#2: Post edited
# [Python 3], 84 bytes- <!-- language-all: lang-python -->
def t(n,*l):d="0+-"[n%3]if n*n<2:return d*(not l or n*n)return t((n+1)//3,1)+d[Try it online!][TIO-kt8blzxx]- [Python 3]: https://docs.python.org/3/
[TIO-kt8blzxx]: https://tio.run/##NU7BCoMwFLv3Kx6FQasV7aw7yNyPDA9jbZkgT6lvhzH27d0TthySQEjI@qLHgm3OPkQghaaYdS/AD7IpK3nFQzsKmCJggedjnwI9E4IvFC4EMyxpD7SAX0BKYWl1XbfG6tJnChvdb1vYYIBrY6AzcDJgLQvbyjmmzjWjiPsSTLzwb/AJxpomJBXlG/uL@0jDD7XOXw "Python 3 – Try It Online"
- # [Python 3], 78 bytes
- <!-- language-all: lang-python -->
- def t(n,*l):d="0+-"[n%3];return d*(not l or n*n) if n*n<2 else t((n+1)//3,1)+d
- [Try it online!][TIO-kt8bpice]
- [Python 3]: https://docs.python.org/3/
- [TIO-kt8bpice]: https://tio.run/##PY6xCoMwGIT3PsURKCQa0dTYwda@iDiUJqGC/EqSDqX02dO49Ia7W77jtnd8rtSmZKxD5CSLRfRmYE1ZsZGO7XTxNr48wRSc1ogFqwcVJDC7Pa8n2CXYjHIqlajrVipRmhRtiI97sAEDxkaikzhLKJUj10rrbJ1upoPb9zAT/kR/QNbmZ4rcsQ/1N/1lMn8TIv0A "Python 3 – Try It Online"
#1: Initial revision
# [Python 3], 84 bytes <!-- language-all: lang-python --> def t(n,*l): d="0+-"[n%3] if n*n<2:return d*(not l or n*n) return t((n+1)//3,1)+d [Try it online!][TIO-kt8blzxx] [Python 3]: https://docs.python.org/3/ [TIO-kt8blzxx]: https://tio.run/##NU7BCoMwFLv3Kx6FQasV7aw7yNyPDA9jbZkgT6lvhzH27d0TthySQEjI@qLHgm3OPkQghaaYdS/AD7IpK3nFQzsKmCJggedjnwI9E4IvFC4EMyxpD7SAX0BKYWl1XbfG6tJnChvdb1vYYIBrY6AzcDJgLQvbyjmmzjWjiPsSTLzwb/AJxpomJBXlG/uL@0jDD7XOXw "Python 3 – Try It Online"