login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A359300 a(n) = (distance from n to nearest prime >= n) - (distance from n to nearest prime <= n). 2
0, 0, 0, 0, 0, 0, 2, 0, -2, 0, 0, 0, 2, 0, -2, 0, 0, 0, 2, 0, -2, 0, 4, 2, 0, -2, -4, 0, 0, 0, 4, 2, 0, -2, -4, 0, 2, 0, -2, 0, 0, 0, 2, 0, -2, 0, 4, 2, 0, -2, -4, 0, 4, 2, 0, -2, -4, 0, 0, 0, 4, 2, 0, -2, -4, 0, 2, 0, -2, 0, 0, 0, 4, 2, 0, -2, -4, 0, 2, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,7
LINKS
FORMULA
a(n) = A007917(n) + A007918(n) - 2*n. - Bernard Schott, Jan 01 2023
EXAMPLE
a(8) = 2 because (11-8) - (8-7) = 2.
MAPLE
f:= n -> nextprime(n-1) + prevprime(n+1) - 2*n:
map(f, [$2..100]); # Robert Israel, Jan 03 2023
MATHEMATICA
u[n_] := If[PrimeQ[n], n, NextPrime[n]];
v[n_] := If[PrimeQ[n], n, NextPrime[n, -1]];
Table[u[n] - n - (n - v[n]), {n, 2, 350}]
CROSSREFS
Sequence in context: A197629 A198255 A290542 * A029834 A318715 A202385
KEYWORD
sign
AUTHOR
Clark Kimberling, Jan 01 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 15:34 EDT 2024. Contains 371794 sequences. (Running on oeis4.)