The prime distance of a nonnegative integer is the absolute difference between and the nearest prime. It is therefore true that for primes . The first few values for , 1, 2, ... are therefore 2, 1, 0, 0, 1, 0, 1, 0, 1, 2, ... (OEIS A051699). The values of having prime distances of 0, 1, 2, 3, ... are 2, 1, 0, 26, 93, 118, 119, 120, 531, 532, 897, ... (OEIS A077019).
Prime Distance
See also
Nearest Prime, Prime Difference Function, Prime GapsExplore with Wolfram|Alpha
References
Sloane, N. J. A. Sequences A051699 and A077019 in "The On-Line Encyclopedia of Integer Sequences."Referenced on Wolfram|Alpha
Prime DistanceCite this as:
Weisstein, Eric W. "Prime Distance." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/PrimeDistance.html