Post History
Description From the Esolangs wiki, In Fractran, a program consists of a finite list of positive, rational numbers. The input to a program is a positive integer n. The list is then searched ...
#4: Post edited
- # Description
- From the [Esolangs wiki,](https://esolangs.org/wiki/Fractran)
- In Fractran,
- - a program consists of a finite list of positive, rational numbers.
- - The input to a program is a positive integer n.
- - The list is then searched in order, for a rational number \$p/q\$ such that \$n×p/q\$ is an integer.
- - Then n is replaced by \$n×p/q\$ and the search is restarted from the beginning of the list.
- - The program halts when no such number \$p/q\$ can be found, and the final n becomes the output from the program.
- - Output the final value of \$n\$.
- Your task is to implement an interpreter for this language.
- # Input
- You are to take two inputs:
- - \$n\$, an integer
- - \$A\$, an array of fractions, which may be taken as a list of pairs, or in the rational datatype of your language.
- # Output
- A single integer, the final value of \$n\$.
- # Test Cases
- Formatted as
- ```
- program
- input
- output
- ```
- ```
- 78/55, 5/3, 1/5, 11/2, 5/7
- 1096135733
21- 3/2
- 1296
- 6561
- 455/33, 11/13, 1/11, 3/7, 11/2, 1/3
- 72
- 15625
- # Description
- From the [Esolangs wiki,](https://esolangs.org/wiki/Fractran)
- In Fractran,
- - a program consists of a finite list of positive, rational numbers.
- - The input to a program is a positive integer n.
- - The list is then searched in order, for a rational number \$p/q\$ such that \$n×p/q\$ is an integer.
- - Then n is replaced by \$n×p/q\$ and the search is restarted from the beginning of the list.
- - The program halts when no such number \$p/q\$ can be found, and the final n becomes the output from the program.
- - Output the final value of \$n\$.
- Your task is to implement an interpreter for this language.
- # Input
- You are to take two inputs:
- - \$n\$, an integer
- - \$A\$, an array of fractions, which may be taken as a list of pairs, or in the rational datatype of your language.
- # Output
- A single integer, the final value of \$n\$.
- # Test Cases
- Formatted as
- ```
- program
- input
- output
- ```
- ```
- 78/55, 5/3, 1/5, 11/2, 5/7
- 1096135733
- 328842888196762472689573703
- 3/2
- 1296
- 6561
- 455/33, 11/13, 1/11, 3/7, 11/2, 1/3
- 72
- 15625
#3: Post edited
- # Description
- From the [Esolangs wiki,](https://esolangs.org/wiki/Fractran)
- In Fractran,
- - a program consists of a finite list of positive, rational numbers.
- - The input to a program is a positive integer n.
- - The list is then searched in order, for a rational number \$p/q\$ such that \$n×p/q\$ is an integer.
- - Then n is replaced by \$n×p/q\$ and the search is restarted from the beginning of the list.
- - The program halts when no such number \$p/q\$ can be found, and the final n becomes the output from the program.
- - Output the final value of \$n\$.
- Your task is to implement an interpreter for this language.
- # Input
- You are to take two inputs:
- - \$n\$, an integer
- - \$A\$, an array of fractions, which may be taken as a list of pairs, or in the rational datatype of your language.
- # Output
- A single integer, the final value of \$n\$.
- # Test Cases
- Formatted as
- ```
- program
- input
- output
- ```
- ```
- 78/55, 5/3, 1/5, 11/2, 5/7
- 1096135733
- 21
17/91, 78/85, 19/51, 23/38, 29/33, 77/29, 95/23, 77/19, 1/17, 11/13, 13/11, 15/14, 15/2, 55/1215- 455/33, 11/13, 1/11, 3/7, 11/2, 1/3
108- 15625
- # Description
- From the [Esolangs wiki,](https://esolangs.org/wiki/Fractran)
- In Fractran,
- - a program consists of a finite list of positive, rational numbers.
- - The input to a program is a positive integer n.
- - The list is then searched in order, for a rational number \$p/q\$ such that \$n×p/q\$ is an integer.
- - Then n is replaced by \$n×p/q\$ and the search is restarted from the beginning of the list.
- - The program halts when no such number \$p/q\$ can be found, and the final n becomes the output from the program.
- - Output the final value of \$n\$.
- Your task is to implement an interpreter for this language.
- # Input
- You are to take two inputs:
- - \$n\$, an integer
- - \$A\$, an array of fractions, which may be taken as a list of pairs, or in the rational datatype of your language.
- # Output
- A single integer, the final value of \$n\$.
- # Test Cases
- Formatted as
- ```
- program
- input
- output
- ```
- ```
- 78/55, 5/3, 1/5, 11/2, 5/7
- 1096135733
- 21
- 3/2
- 1296
- 6561
- 455/33, 11/13, 1/11, 3/7, 11/2, 1/3
- 72
- 15625
#2: Post edited
- # Description
- From the [Esolangs wiki,](https://esolangs.org/wiki/Fractran)
- In Fractran,
- - a program consists of a finite list of positive, rational numbers.
- - The input to a program is a positive integer n.
- - The list is then searched in order, for a rational number \$p/q\$ such that \$n×p/q\$ is an integer.
- - Then n is replaced by \$n×p/q\$ and the search is restarted from the beginning of the list.
- - The program halts when no such number \$p/q\$ can be found, and the final n becomes the output from the program.
- - Output the final value of \$n\$.
- Your task is to implement an interpreter for this language.
- # Input
- You are to take two inputs:
- - \$n\$, an integer
- - \$A\$, an array of fractions, which may be taken as a list of pairs, or in the rational datatype of your language.
- # Output
- A single integer, the final value of \$n\$.
- # Test Cases
- Formatted as
- ```
- program
- input
- output
- ```
- ```
2/3,3/2(None)Loops infinitely- 17/91, 78/85, 19/51, 23/38, 29/33, 77/29, 95/23, 77/19, 1/17, 11/13, 13/11, 15/14, 15/2, 55/1
- 2
- 15
- 455/33, 11/13, 1/11, 3/7, 11/2, 1/3
- 108
- 15625
- # Description
- From the [Esolangs wiki,](https://esolangs.org/wiki/Fractran)
- In Fractran,
- - a program consists of a finite list of positive, rational numbers.
- - The input to a program is a positive integer n.
- - The list is then searched in order, for a rational number \$p/q\$ such that \$n×p/q\$ is an integer.
- - Then n is replaced by \$n×p/q\$ and the search is restarted from the beginning of the list.
- - The program halts when no such number \$p/q\$ can be found, and the final n becomes the output from the program.
- - Output the final value of \$n\$.
- Your task is to implement an interpreter for this language.
- # Input
- You are to take two inputs:
- - \$n\$, an integer
- - \$A\$, an array of fractions, which may be taken as a list of pairs, or in the rational datatype of your language.
- # Output
- A single integer, the final value of \$n\$.
- # Test Cases
- Formatted as
- ```
- program
- input
- output
- ```
- ```
- 78/55, 5/3, 1/5, 11/2, 5/7
- 1096135733
- 21
- 17/91, 78/85, 19/51, 23/38, 29/33, 77/29, 95/23, 77/19, 1/17, 11/13, 13/11, 15/14, 15/2, 55/1
- 2
- 15
- 455/33, 11/13, 1/11, 3/7, 11/2, 1/3
- 108
- 15625
#1: Initial revision
Golf a FRACTRAN interpreter
# Description From the [Esolangs wiki,](https://esolangs.org/wiki/Fractran) In Fractran, - a program consists of a finite list of positive, rational numbers. - The input to a program is a positive integer n. - The list is then searched in order, for a rational number \$p/q\$ such that \$n×p/q\$ is an integer. - Then n is replaced by \$n×p/q\$ and the search is restarted from the beginning of the list. - The program halts when no such number \$p/q\$ can be found, and the final n becomes the output from the program. - Output the final value of \$n\$. Your task is to implement an interpreter for this language. # Input You are to take two inputs: - \$n\$, an integer - \$A\$, an array of fractions, which may be taken as a list of pairs, or in the rational datatype of your language. # Output A single integer, the final value of \$n\$. # Test Cases Formatted as ``` program input output ``` ``` 2/3,3/2 (None) Loops infinitely 17/91, 78/85, 19/51, 23/38, 29/33, 77/29, 95/23, 77/19, 1/17, 11/13, 13/11, 15/14, 15/2, 55/1 2 15 455/33, 11/13, 1/11, 3/7, 11/2, 1/3 108 15625