OFFSET
2,1
COMMENTS
LINKS
Lei Zhou, Table of n, a(n) for n = 2..10001
EXAMPLE
For n = 2, A007694(2) = 2, testing k*2-1 for k in set {1, 5, 7, 11, 13, 17, 19... }, we find that 7*2 - 1 = 13 is the first prime number found. So a(2) = 7;
In the similar way, 1*A007694(3) - 1 = 1*4 - 1 = 3 is the first prime number found for n = 3, so a(3) = 1.
For n = 7, A007694(7) = 16, 5*16 - 1 = 89 is the smallest prime found, so a(7) = 5.
MATHEMATICA
b = 2; a = {b}; sm = {}; r = a; While[Length[sm] < 81, f = 0;
While[f++; (fc = FactorInteger[f];
MemberQ[{2, 3}, fc[[1, 1]]]) || (! PrimeQ[f*a[[Length[a]]] - 1])];
AppendTo[sm, f]; c = r*2; d = r*3; e = Sort[Union[c, d]]; i = 1;
While[e[[i]] <= a[[Length[a]]], i++]; AppendTo[a, e[[i]]];
AppendTo[r, e[[i]]];
While[(3*r[[1]]) < r[[Length[r]]], r = Delete[r, 1]]]; sm
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Lei Zhou, Apr 19 2017
STATUS
approved