Quickest procedure needed

Artur grafix at csl.pl
Mon Jan 15 19:01:43 CET 2007


I would like to ask more advanced in Mathematica seqfans about improove  
procedure to do much quikest (my is extremaly slowly)
a = {}; Do[d = (Prime[n + 1] - Prime[n])/Log[Prime[n]] // N; If[d > 1,  
AppendTo[a,Prime[n]]], {n, 1, 2263}]; a

ARTUR




On 1/15/07 1:01 PM Artur wrote:

> 
> I would like to ask more advanced in Mathematica seqfans about improove
> procedure to do much quikest (my is extremaly slowly)
> a = {}; Do[d = (Prime[n + 1] - Prime[n])/Log[Prime[n]] // N; If[d > 1,
> AppendTo[a,Prime[n]]], {n, 1, 2263}]; a
> 
> ARTUR
> 
> 
Try first computing the primes up to Prime[2264]:

T = Table[Prime[n], {n, 1, 2264}]; a = {}; Do[d = (T[[n + 1]] -
T[[n]])/Log[T[[n]]] // N; If[d > 1, AppendTo[a,T[[n]]]], {n, 1, 2263}]; a

Jonathan






More information about the SeqFan mailing list