%I #38 Oct 05 2021 08:28:19
%S 10,5,36,858,234,5577,1521,3549,8281,910,100,50,25,180,3388,924,252,
%T 6006,1638,39039,10647,24843,57967,6370,700,300,7150,1950,46475,12675,
%U 29575,3250,360,6776,1848,504,12012,3276,78078,21294,507507,138411,322959,753571
%N Successive integers produced by Conway's PRIMEGAME using Kilminster's Fractran program with only nine fractions.
%C The exponents of exact powers of 10 in this sequence are 1, followed by the successive primes (A008578).
%D D. Olivastro, Ancient Puzzles. Bantam Books, NY, 1993, p. 21.
%H Alois P. Heinz, <a href="/A183132/b183132.txt">Table of n, a(n) for n = 1..10547</a>
%H J. H. Conway, <a href="http://dx.doi.org/10.1007/978-1-4612-4808-8_2">FRACTRAN: a simple universal programming language for arithmetic</a>, in T. M. Cover and Gopinath, eds., Open Problems in Communication and Computation, Springer, NY 1987, pp. 4-26.
%H Esolang wiki, <a href="http://www.esolangs.org/wiki/Fractran">Fractran</a>
%H Chaim Goodman-Strauss, <a href="http://www.ams.org/notices/201003/rtx100300343p.pdf">Can’t Decide? Undecide!</a>, Notices of the AMS, Volume 57, Number 3, pp. 343-356, March 2010.
%H R. K. Guy, <a href="http://www.jstor.org/stable/2690263">Conway's prime producing machine</a>, Math. Mag. 56 (1983), no. 1, 26-33.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/FRACTRAN.html">FRACTRAN</a>.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/FRACTRAN">FRACTRAN</a>.
%p l:= [3/11, 847/45, 143/6, 7/3, 10/91, 3/7, 36/325, 1/2, 36/5]:
%p a:= proc(n) option remember;
%p global l;
%p local p, k;
%p if n=1 then 10
%p else p:= a(n-1);
%p for k while not type(p*l[k], integer)
%p do od; p*l[k]
%p fi
%p end:
%p seq(a(n), n=1..50);
%t l = {3/11, 847/45, 143/6, 7/3, 10/91, 3/7, 36/325, 1/2, 36/5};
%t a[n_] := a[n] = Module[{p, k}, If[n == 1, 10, p = a[n - 1]; For[k = 1, !IntegerQ[p*l[[k]]], k++]; p*l[[k]]]];
%t Array[a, 50] (* _Jean-François Alcover_, May 28 2018, from Maple *)
%o (Python)
%o from fractions import Fraction
%o nums = [ 3, 847, 143, 7, 10, 3, 36, 1, 36]
%o dens = [11, 45, 6, 3, 91, 7, 325, 2, 5]
%o PRIMEGAME = [Fraction(num, den) for num, den in zip(nums, dens)]
%o def succ(n, program):
%o for i in range(len(program)):
%o if (n*program[i]).denominator == 1: return (n*program[i]).numerator
%o def orbit(start, program, steps):
%o orb = [start]
%o for s in range(1, steps): orb.append(succ(orb[-1], program))
%o return orb
%o print(orbit(10, PRIMEGAME, steps=44)) # _Michael S. Branicky_, Oct 05 2021
%Y Cf. A183133, A008578, A007542, A007546, A007547.
%K easy,look,nonn
%O 1,1
%A _Alois P. Heinz_, Dec 26 2010
|