User:Thebigh/mysandbox

From Rosetta Code
Revision as of 22:13, 22 November 2021 by Thebigh (talk | contribs) (more)

Some FRACTRAN programs in case we ever have a category for it

Integer Sequence

<lang fractran> 1 {2/3, 9/2, 2/1}</lang>

Output:

2^0 2^1 3^2 2 x 3 2^2 2 x 3^2 2^2 x 3 2^3 ...

Regarding only the powers of two, we get 1,2,4,8,16, etc.

Sort three variables

<lang fractran> 2^a*3^b*5^c {1001/30, 143/6, 143/10, 143/15, 13/2, 13/3, 13/5} </lang> Returns 7^A 11^B 13^C where (A,B,C) are (a,b,c) in ascending order.