The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A305748 Distance of a prime number from the average of the next two consecutive prime numbers. 0
2, 3, 4, 5, 4, 5, 4, 7, 7, 5, 8, 5, 4, 7, 9, 7, 5, 8, 5, 5, 8, 7, 10, 10, 5, 4, 5, 4, 11, 16, 7, 7, 7, 11, 5, 9, 8, 7, 9, 7, 7, 11, 4, 5, 8, 18, 14, 5, 4, 7, 7, 7, 13, 9, 9, 7, 5, 8, 5, 7, 17, 16, 5, 4, 11, 17, 11, 11, 4, 7, 10, 11, 9, 8, 7, 10, 10, 8, 13, 11, 7, 11, 5, 8, 7, 10, 10, 5, 4, 10, 16, 10, 8, 10, 7, 12, 13 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
a(n) = A024675(n) - A000040(n).
EXAMPLE
For n=4 prime(4) = 7. The next two primes are 11, 13 and the average (11 + 13) / 2 = 12. So 12 - 7 = 5 and a(4) = 5.
MATHEMATICA
Map[Mean@ Rest@ # - First@ # &, Partition[Prime@ Range@ 99, 3, 1]] (* Michael De Vlieger, Jun 11 2018 *)
PROG
(PARI) { forprime(n = 2, 100, p1 = nextprime(n+1); p2 = nextprime(p1 + 1);
print1((p1 + p2) / 2 - n", ")) }
CROSSREFS
Sequence in context: A291520 A354445 A317646 * A302981 A205785 A303235
KEYWORD
nonn,easy
AUTHOR
Dimitris Valianatos, Jun 09 2018
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 May 29 00:29 EDT 2024. Contains 372921 sequences. (Running on oeis4.)