All positive integers can be written in the form where and each .
This is called the sesquinary (for “one and a half”) representation of a positive integer.
That this is possible, and an algorithm for carrying out the representation, follows fairly directly from an application of Jim Tanton’s exploding dots machines: a machine in particular.
Here’s how we can get the sesquinary representation of 29, and get an instant feel for how a general algorithm for the sesquinary representation of any positive integer works (such is the intuitive power of exploding dots):
We begin with 29 dots placed in the right-most box in the diagram below and then successively “explode” groups of 3 to groups of 2 one box to the right:
This suggests right away a general algorithm for finding the digits in a sesquinary representation of a positive integer n:
divide n into as many groups of 3 as possible: this is the integer part of n/3;
remove all these groups of 3 from the box in which n resides(the right-most box to start) and place 2 times that many dots in the box to the left: this is the new n;
the digit to be recorded is the number of dots (0, 1 or 2) left in the box in which n was originally;
keep doing this until n is 1 or 2.
Here’s the algorithm written in Mathematica® code: