%I #16 Oct 02 2018 18:35:26
%S 2,6,6,6,6,12,18,8,12,6,6,18,24,6,8,12,6,12,30,10,18,14,12,6,6,6,30,
%T 18,24,36,20,12,18,30,6,10,30,6,18,12,42,6,30,30,12,16,6,12,48,18,30,
%U 30,6,6,8,12,6,30,30,24,24,6
%N a(n) = least integer m such that prime(n)+m and prime(n+1)+m are prime.
%C In most cases terms are congruent to 0 mod 6. Out of the first 1000 terms, 830 are multiples of 6.
%C It is conjectured that a(n) always exists.
%H Colin Barker, <a href="/A247097/b247097.txt">Table of n, a(n) for n = 2..10000</a>
%e Offset is 2, hence first term corresponds to n=2.
%e For n=2, prime(n)=3, prime(n+1)=5, m=2, and 3+2 and 5+2 are prime.
%e For n=3, m=6, 5+6 and 7+6 are prime.
%t lm[{a_,b_}]:=Module[{m=2},While[!PrimeQ[a+m]||!PrimeQ[b+m],m+=2];m]; lm/@ Partition[ Prime[Range[2,70]],2,1] (* _Harvey P. Dale_, Oct 02 2018 *)
%o (PARI) s=[]; for(n=2, 100, p=prime(n); q=prime(n+1); m=1; while(!(isprime(p+m)&&isprime(q+m)), m++); s=concat(s, m)); s \\ _Colin Barker_, Nov 18 2014
%K nonn
%O 2,1
%A _Zak Seidov_, Nov 18 2014