A257230 Floor(sqrt(q)-(q-p)), where p and q are consecutive primes.
0, 0, 0, -1, 1, 0, 2, 0, -1, 3, 0, 2, 4, 2, 1, 1, 5, 2, 4, 6, 2, 5, 3, 1, 6, 8, 6, 8, 6, -3, 7, 5, 9, 2, 10, 6, 6, 8, 7, 7, 11, 3, 11, 10, 12, 2, 2, 11, 13, 11, 9, 13, 5, 10, 10, 10, 14, 10, 12, 14, 7, 3, 13, 15, 13, 4, 12, 8, 16, 14, 12, 11, 13, 13, 15, 13, 11, 16, 12, 10, 18
Offset: 1
Examples
a(30) = -3 because sqrt(127)-(127-113) = -2.73057... a(31) = 7 because sqrt(131)-(131-127) = 7.44552...
Links
- Chris Boyd, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Prime Gaps
- Wikipedia, Legendre's conjecture
Crossrefs
Cf. A257231.
Programs
-
Magma
[Floor(Sqrt(NthPrime(n+1))-(NthPrime(n+1)-NthPrime(n))): n in [1..100]]; // Vincenzo Librandi, Apr 19 2015
-
Mathematica
Table[Floor[Sqrt[NextPrime[Prime@ p]] - (NextPrime[Prime@ p] - Prime@ p)], {p, 81}] (* Michael De Vlieger, Apr 19 2015 *)
-
PARI
a(n)=floor(sqrt(prime(n+1))-(prime(n+1)-prime(n)))
Comments