login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A183133 Number of steps to compute the n-th prime in PRIMEGAME using Kilminster's Fractran program with only nine fractions. 4

%I #29 Apr 02 2021 02:45:21

%S 10,46,196,500,1428,2488,4588,6840,10546,17118,23064,33332,44472,

%T 55848,70330,90836,115136,137912,168802,201000,233542,276680,320332,

%U 373198,439722,503810,568334,640092,712314,792186,917090,1023878,1146632,1263818,1419298

%N Number of steps to compute the n-th prime in PRIMEGAME using Kilminster's Fractran program with only nine fractions.

%D D. Olivastro, Ancient Puzzles. Bantam Books, NY, 1993, p. 21.

%H Alois P. Heinz, <a href="/A183133/b183133.txt">Table of n, a(n) for n = 1..100</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 a:= proc(n) option remember;

%p local l,p,m,k;

%p l:= [3/11, 847/45, 143/6, 7/3, 10/91, 3/7, 36/325, 1/2, 36/5]:

%p if n=1 then b(0):= 10; a(0):= 0

%p else a(n-1)

%p fi;

%p p:= b(n-1);

%p for m do

%p for k while not type(p*l[k], integer)

%p do od; p:= p*l[k];

%p if 10^ilog10(p)=p then break fi

%p od:

%p b(n):= p;

%p m + a(n-1)

%p end:

%p seq(a(n), n=1..20);

%t a[n_] := a[n] = Module[{l, p, m, k},

%t l = {3/11, 847/45, 143/6, 7/3, 10/91, 3/7, 36/325, 1/2, 36/5};

%t If[n == 1, b[0] = 10; a[0] = 0, a[n - 1]]; p = b[n - 1];

%t For[m = 1, True, m++,

%t For[k = 1, !IntegerQ[p*l[[k]]], k++];

%t p = p*l[[k]];If[10^(Length@IntegerDigits[p]-1) == p, Break[]]];

%t b[n] = p; m + a[n - 1]];

%t Array[a, 20] (* _Jean-François Alcover_, Apr 02 2021, after _Alois P. Heinz_ *)

%Y Cf. A183132, A008578, A007542, A007546, A007547.

%K easy,nonn

%O 1,1

%A _Alois P. Heinz_, Dec 26 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 4 06:09 EDT 2024. Contains 374905 sequences. (Running on oeis4.)