OFFSET
1,1
COMMENTS
Number of terms less than 10^n: 2, 8, 26, 85, 224, 511, 1035, 1905, 3338, ..., . - Robert G. Wilson v, Nov 30 2016
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..7589
EXAMPLE
a(1) = 3 because this is the first prime for which it is possible to determine the ratio between the distance to the next prime (5) and from the previous prime (2). This first ratio is 2.
a(2) = 5 because the ratio between the distance to the next prime (7) and from the previous prime (3) is 1 and this ratio has not appeared before.
The third element a(3) is not 7 because (11-7)/(7-5) = 2, a ratio that appeared before with a(1), so a(3) = 11 because (13-11)/(11-7) = 1/2, a ratio that did not appear before.
MATHEMATICA
nmax = 720;
a = Prime[Range[nmax]];
gaps = Rest[a] - Most[a];
gapsratio = Rest[gaps]/Most[gaps];
newpindex = {}; newgratios = {}; i = 1;
While[i < Length[gapsratio] + 1,
If[Cases[newgratios, gapsratio[[i]]] == {},
AppendTo[newpindex, i + 1];
AppendTo[newgratios, gapsratio[[i]]] ];
i++];
Prime[newpindex]
p = 2; q = 3; r = 5; rtlst = qlst = {}; While[q < 10000, rt = (r - q)/(q - p); If[ !MemberQ[rtlst, rt], AppendTo[rtlst, rt]; AppendTo[qlst, q]]; p = q; q = r; r = NextPrime@ r]; qlst (* Robert G. Wilson v, Nov 30 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Andres Cicuttin, Nov 14 2016
STATUS
approved