OFFSET
1,1
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
KEYWORD
nonn,easy
AUTHOR
Dimitris Valianatos, Jun 09 2018
STATUS
approved