A060266 Difference between 2n and the following prime.
1, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 5, 3, 1, 1, 5, 3, 1, 3, 1, 1, 3, 1, 5, 3, 1, 5, 3, 1, 1, 5, 3, 1, 3, 1, 1, 5, 3, 1, 3, 1, 5, 3, 1, 7, 5, 3, 1, 3, 1, 1, 3, 1, 1, 3, 1, 13, 11, 9, 7, 5, 3, 1, 3, 1, 5, 3, 1, 1, 9, 7, 5, 3, 1, 1, 5, 3, 1, 5, 3, 1, 3, 1, 5, 3, 1, 5, 3, 1, 1, 9, 7, 5, 3, 1, 1, 3, 1, 1, 11, 9, 7, 5
Offset: 1
Keywords
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
Programs
-
Maple
with(numtheory): [seq(nextprime(2*i)-2*i,i=1..256)];
-
Mathematica
d2n[n_]:=Module[{c=2n},NextPrime[c]-c]; Array[d2n,120] (* Harvey P. Dale, May 14 2011 *) Table[NextPrime@ # - # &[2 n], {n, 120}] (* Michael De Vlieger, Feb 18 2017 *)
-
PARI
a(n) = nextprime(2*n+1) - 2*n; \\ Michel Marcus, Feb 19 2017
Formula
Conjecture: Limit_{n->oo} (Sum_{k=1..n} a(k)) / (Sum_{k=1..n} log(2*k)) = 1. - Alain Rocchelli, Oct 24 2023