OFFSET
1,1
COMMENTS
a(n) is smallest prime greater than prime(n)/2. - Peter Munn, Sep 18 2017
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = nextprime(prime(n)/2) ~ (n log n)/2. - Charles R Greathouse IV, Mar 17 2015
Conjecture: a(n) = A039734(n), n>=2. - R. J. Mathar, May 03 2021
EXAMPLE
n=6: prime(6)=13 and 13 mod(2*2)=1, 13 mod(2*3)=1, 13 mod(2*5)=3, 13 mod(2*7)=13, therefore a(6)=7.
MATHEMATICA
f[n_] := Block[{p = 2}, While[Prime@ n != Mod[Prime@ n, 2 p], p = NextPrime@ p]; p]; Array[f, 64] (* Michael De Vlieger, Mar 17 2015 *)
PROG
(PARI) a(n, q=prime(n))=nextprime(q/2) \\ Charles R Greathouse IV, Mar 17 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Jan 19 2003
STATUS
approved