Wolfram Research

Function Repository Resource:

BinaryCodedTernary

Source Notebook

Self-delimiting number representation

Contributed by: Stephen Wolfram

ResourceFunction["BinaryCodedTernary"][n]

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

Details and Options

From A New Kind of Science, page 1070 (section 10.4).

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]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Resource History

License Information