Nov 02, 2010 09:08
Here's a FRACTRAN program to compute Fibonacci numbers. Input is 2^n, output is 3^fib(n)
13/11 133/85 17/19 23/17 1015/69 23/29 31/23 111/217 31/37 13/31 17/26 33/2 1/13 1/5
And one that sums up the first n integers (input: 2^n , output: 3^(1+2+3+...+n)):
165/14 7/11 13/7 17/65 38/85 17/19 1/17 105/2
And one that squares a number (2^n -> 3^(n^2))
2415/38 19/23 285/2 561/65 13/17 1/13 5/11 13/7 1/5 1/19
And one that adds the first n squares (2^n -> 3^(1+4+9+...+n^2))
7315/34 17/19 23/17 1131/115 23/29 31/161 185/403 31/37 17/31 41/23 43/533 41/43 47/41 106/517 47/53 85/2 1/47
math,
programming,
fractran