<s>
FRACTRAN	B-Application
is	O
a	O
Turing-complete	O
esoteric	O
programming	O
language	O
invented	O
by	O
the	O
mathematician	O
John	O
Conway	O
.	O
</s>
<s>
A	O
FRACTRAN	B-Application
program	O
is	O
an	O
ordered	O
list	O
of	O
positive	O
fractions	O
together	O
with	O
an	O
initial	O
positive	O
integer	O
input	O
n	O
.	O
The	O
program	O
is	O
run	O
by	O
updating	O
the	O
integer	O
n	O
as	O
follows	O
:	O
</s>
<s>
gives	O
the	O
following	O
FRACTRAN	B-Application
program	O
,	O
called	O
PRIMEGAME	B-Application
,	O
which	O
finds	O
successive	O
prime	O
numbers	O
:	O
</s>
<s>
Starting	O
with	O
n	O
=	O
2	O
,	O
this	O
FRACTRAN	B-Application
program	O
generates	O
the	O
following	O
sequence	O
of	O
integers	O
:	O
</s>
<s>
A	O
FRACTRAN	B-Application
program	O
can	O
be	O
seen	O
as	O
a	O
type	O
of	O
register	B-Application
machine	I-Application
where	O
the	O
registers	O
are	O
stored	O
in	O
prime	O
exponents	O
in	O
the	O
argument	O
n	O
.	O
</s>
<s>
A	O
FRACTRAN	B-Application
program	O
is	O
an	O
ordered	O
list	O
of	O
positive	O
fractions	O
.	O
</s>
<s>
Since	O
the	O
FRACTRAN	B-Application
program	O
is	O
just	O
a	O
list	O
of	O
fractions	O
,	O
these	O
test-decrement-increment	O
instructions	O
are	O
the	O
only	O
allowed	O
instructions	O
in	O
the	O
FRACTRAN	B-Application
language	O
.	O
</s>
<s>
Therefore	O
each	O
FRACTRAN	B-Application
instruction	O
consumes	O
variables	O
as	O
it	O
tests	O
them	O
.	O
</s>
<s>
It	O
is	O
not	O
possible	O
for	O
a	O
FRACTRAN	B-Application
instruction	O
to	O
directly	O
test	O
if	O
a	O
variable	O
is	O
0	O
(	O
However	O
,	O
an	O
indirect	O
test	O
can	O
be	O
implemented	O
by	O
creating	O
a	O
default	O
instruction	O
that	O
is	O
placed	O
after	O
other	O
instructions	O
that	O
test	O
a	O
particular	O
variable	O
.	O
</s>
<s>
In	O
order	O
to	O
do	O
this	O
we	O
need	O
to	O
introduce	O
states	B-Application
into	O
our	O
algorithm	O
.	O
</s>
<s>
We	O
can	O
implement	O
states	B-Application
using	O
new	O
variables	O
as	O
state	O
indicators	O
.	O
</s>
<s>
Adding	O
FRACTRAN	B-Application
state	O
indicators	O
and	O
instructions	O
to	O
the	O
multiplication	O
algorithm	O
table	O
,	O
we	O
have	O
:	O
</s>
<s>
When	O
we	O
write	O
out	O
the	O
FRACTRAN	B-Application
instructions	O
,	O
we	O
must	O
put	O
the	O
state	O
A	O
instructions	O
last	O
,	O
because	O
state	O
A	O
has	O
no	O
state	O
indicators	O
-	O
it	O
is	O
the	O
default	O
state	O
if	O
no	O
state	O
indicators	O
are	O
set	O
.	O
</s>
<s>
So	O
as	O
a	O
FRACTRAN	B-Application
program	O
,	O
the	O
multiplier	O
becomes	O
:	O
</s>
<s>
In	O
a	O
similar	O
way	O
,	O
we	O
can	O
create	O
a	O
FRACTRAN	B-Application
"	O
subtractor	O
"	O
,	O
and	O
repeated	O
subtractions	O
allow	O
us	O
to	O
create	O
a	O
"	O
quotient	O
and	O
remainder	O
"	O
algorithm	O
as	O
follows	O
:	O
</s>
<s>
Writing	O
out	O
the	O
FRACTRAN	B-Application
program	O
,	O
we	O
have	O
:	O
</s>
<s>
The	O
following	O
FRACTRAN	B-Application
program	O
:	O
</s>
