A252477 Integer part of 1/(sqrt(prime(n+1))-sqrt(prime(n))).
3, 1, 2, 1, 3, 1, 4, 2, 1, 5, 1, 3, 6, 3, 2, 2, 7, 2, 4, 8, 2, 4, 3, 2, 4, 10, 5, 10, 5, 1, 5, 3, 11, 2, 12, 4, 4, 6, 4, 4, 13, 2, 13, 6, 14, 2, 2, 7, 15, 7, 5, 15, 3, 5, 5, 5, 16, 5, 8, 16, 3, 2, 8, 17, 8, 2, 6, 3, 18, 9, 6, 4, 6, 6, 9, 6, 4, 9, 5, 4, 20, 4, 20, 6, 10, 7, 5, 10, 21, 10, 3, 5
Offset: 1
Examples
a(1) = floor(1/(sqrt(3) - sqrt(2))) = floor(1/(1.73-1.41)) = floor(1/0.32) = floor(3.15) = 3. a(2) = floor(1/(sqrt(5) - sqrt(3))) = floor(1/(2.236-1.732)) = floor(1/0.504) = floor(1.98) = 1.
Links
- M. F. Hasler, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Andrica's conjecture
Programs
-
Haskell
a252477 n = a252477_list !! (n-1) a252477_list = map (floor . recip) $ zipWith (-) (tail rs) rs where rs = map (sqrt . fromIntegral) a000040_list -- Reinhard Zumkeller, Jan 04 2015
-
Maple
a:= n-> ((w, v)-> floor(1/(w-v)))(map(sqrt@ithprime, [n+1, n])[]): seq(a(n), n=1..92); # Alois P. Heinz, Aug 23 2025
-
Mathematica
Floor[1/Subtract @@@ Reverse[Partition[Sqrt[Prime[Range[100]]], 2, 1], 2]] (* Paolo Xausa, Aug 24 2025 *)
-
PARI
a(n)=1\(sqrt(prime(n+1))-sqrt(prime(n))) \\ M. F. Hasler, Dec 31 2014
Formula
a(n) = A079636(n) - 1. - Alois P. Heinz, Aug 23 2025
Comments