OFFSET
1,1
FORMULA
Conjectural inequality: for n>=2, a(n) <= log^2(n*a(n)). This essentially corresponds to Cramer's conjecture for prime gaps.
EXAMPLE
If n=3, then, for j=1, nextprime(3)<=6; for j=2, nextprime(6)<=9; for j=3,nextprime(9)<=12; for j=4, nextprime(12)<=15; for j=5, nextprime(15)<=18; for j=6,nextprime(18)<=21; for j=7, nextprime(21)<=24, BUT for j=8, nextprime(24)>27. Thus a(3)=7.
MATHEMATICA
a[n_] := For[k = 1, True, k++, If[NextPrime[k*n] <= (k+1)*n && NextPrime[(k+1)*n] > (k+2)*n, Return[k]]]; Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Sep 05 2013 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Sep 04 2013
EXTENSIONS
More terms from Peter J. C. Moses
STATUS
approved