OFFSET
1,7
COMMENTS
Conjecture: a(n) is always positive for n > 30, and is negative only for n = 4, 9 and 30, corresponding to prime pairs (7, 11), (23, 29) and (113, 127).
Related to prime gap conjectures by (e.g.) Legendre, Oppermann, Andrica and Brocard.
LINKS
Chris Boyd, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Prime Gaps
Wikipedia, Legendre's conjecture
EXAMPLE
a(30) = -3 because sqrt(127)-(127-113) = -2.73057...
a(31) = 7 because sqrt(131)-(131-127) = 7.44552...
MATHEMATICA
Table[Floor[Sqrt[NextPrime[Prime@ p]] - (NextPrime[Prime@ p] - Prime@ p)], {p, 81}] (* Michael De Vlieger, Apr 19 2015 *)
PROG
(PARI) a(n)=floor(sqrt(prime(n+1))-(prime(n+1)-prime(n)))
(Magma) [Floor(Sqrt(NthPrime(n+1))-(NthPrime(n+1)-NthPrime(n))): n in [1..100]]; // Vincenzo Librandi, Apr 19 2015
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Chris Boyd, Apr 19 2015
STATUS
approved