Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
A self-delimiting number representation
| ResourceFunction["BinaryCodedTernary"][n] gives the digits for the integer n encoded in binary-coded ternary. | 
Binary-coded ternary for 9:
| In[1]:= | ![ResourceFunction["BinaryCodedTernary"][9]](https://www.wolframcloud.com/obj/resourcesystem/images/fed/fedab380-c012-4b8a-97cb-246f003cecb4/219e1ac42fe05990.png) | 
| Out[1]= |  | 
Binary-coded ternary for numbers up to 30:
| In[2]:= | ![ArrayPlot[
 PadLeft[Table[ResourceFunction["BinaryCodedTernary"][n], {n, 30}]], Mesh -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/fed/fedab380-c012-4b8a-97cb-246f003cecb4/3eec1a060608a16a.png) | 
| Out[2]= |  | 
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License