Answer 3: Generating Numbers with Unary Functions

Last modified: Wed Aug 29 22:25:43 2001 JST

Preliminaries

We use x to denote the accumulator of the calculator. Now, we can define following instructions.

Two-Counter Machine

Now, we define a two-counter machine. We use a and b to denote two counters storing natural number values (including zero). Counter values are encoded by

    x = 2^a 5^b

At first, we define conditional goto's. Since we already have non-conditional goto instructions, we can use the following control structures, where C is one of the above conditions, or their Boolean expression combination. Now we can define following instructions. Please note that u-v means max(u-v,0) in the following definitions. The followings are Input/Output instructins.

Many-Counter Machine

Now, we define a many-counter machine, which is equivalent to the Turing machine. We use r1, r2, ... to denote counters storing natural number values (including zero). Counter values are encoded by

    a = 2^r1 3^r2 5^r3 ... pi^ri ...
where pi means i-th prime number.

The followings are primitive instructins. The followings are Input/Output instructins.
Naoyuki Tamura