Skip to content
FRACTRAN
EntityQ3063395· pop 11· linked from 17 articles

FRACTRAN is a Turing-complete esoteric programming language invented by the mathematician John Conway. A FRACTRAN program is an ordered list of positive fractions together with an initial positive integer input n. The program is run by updating the integer n as follows: for the first fraction f in the list for which nf is an integer, replace n by nf repeat this rule until no fraction in the list produces an integer when multiplied by n, then halt.

Wikidata facts

Show 1 more fact
Commons category
Fractran (programming language)

via Wikidata · CC0

~12 min read

Article

11 sections
Contents
  • Understanding a FRACTRAN program
  • Creating simple programs
  • Addition
  • Multiplication
  • Subtraction and division
  • Conway's prime algorithm
  • Other examples
  • Notes
  • See also
  • References
  • External links

FRACTRAN is a Turing-complete esoteric programming language invented by the mathematician John Conway. A FRACTRAN program is an ordered list of positive fractions together with an initial positive integer input n. The program is run by updating the integer n as follows: for the first fraction f in the list for which nf is an integer, replace n by nf repeat this rule until no fraction in the list produces an integer when multiplied by n, then halt.

gives the following FRACTRAN program, called PRIMEGAME, which finds successive prime numbers:

Available in 10 languages

via Wikidata sitelinks · CC0

Connections

Categories