Wolfram Research

BinaryCodedTernary

Contributed by: Stephen Wolfram

Source Notebook

Self-delimiting number representation

ResourceFunction["BinaryCodedTernary"][n]

gives the digits for the integer n encoded in binary-coded ternary.

Examples

Basic Examples

Binary-coded ternary for 9:

In[1]:=
ResourceFunction["BinaryCodedTernary"][9]
Out[1]=

Binary-coded ternary for numbers up to 30:

In[2]:=
ArrayPlot[
 PadLeft[Table[ResourceFunction["BinaryCodedTernary"][n], {n, 30}]], Mesh -> True]
Out[2]=

Resource History