login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Difference between 2n and the following prime.
8

%I #20 Nov 28 2023 14:26:48

%S 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,

%T 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,

%U 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

%N Difference between 2n and the following prime.

%H Michael De Vlieger, <a href="/A060266/b060266.txt">Table of n, a(n) for n = 1..10000</a>

%F Conjecture: Limit_{n->oo} (Sum_{k=1..n} a(k)) / (Sum_{k=1..n} log(2*k)) = 1. - _Alain Rocchelli_, Oct 24 2023

%p with(numtheory): [seq(nextprime(2*i)-2*i,i=1..256)];

%t d2n[n_]:=Module[{c=2n},NextPrime[c]-c]; Array[d2n,120] (* _Harvey P. Dale_, May 14 2011 *)

%t Table[NextPrime@ # - # &[2 n], {n, 120}] (* _Michael De Vlieger_, Feb 18 2017 *)

%o (PARI) a(n) = nextprime(2*n+1) - 2*n; \\ _Michel Marcus_, Feb 19 2017

%Y Cf. A020482, A049653, A060267, A060268, A060264.

%K nonn

%O 1,4

%A _Labos Elemer_, Mar 23 2001