%I #30 May 25 2020 09:18:18
%S 8,12,5,42,198,52,68,152,138,696,186,222,410,172,564,1272,472,1220,
%T 268,852,1460,2212,1494,712,1164,1818,618,1284,872,2486,508,786,548,
%U 1668,1192,906,3768,978,668,6228,3222,6516,3820,772,4728,3980,6330,892,5448,1374
%N Smallest sum s of two consecutive primes such that s = 0 mod prime(n).
%C Besides a(3)=5, all terms are even and >=4. - _Zak Seidov_, Nov 29 2014
%H Charles R Greathouse IV, <a href="/A203836/b203836.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = 4*prime(n) if prime(n) is in A118134. - _Robert Israel_, May 25 2020
%e a(1) = 8 = 3 + 5 is the least sum of two consecutive primes that is a multiple of prime(1) = 2.
%e a(3) = 5 = 2 + 3 is the least sum of two consecutive primes that is a multiple of prime(3) = 5.
%p N := 100: # for a(1)..a(N)
%p M := ithprime(N):
%p V := Vector(M):
%p count:= 0:
%p for i from 1 while count < N do
%p x:= ithprime(i)+ithprime(i+1);
%p Q:= convert(select(t -> t <= M and V[t]=0, numtheory:-factorset(x)), list);
%p V[Q]:= x;
%p count:= count + nops(Q);
%p od:
%p seq(V[ithprime(i)], i=1..N); # _Robert Israel_, May 25 2020
%t pr=Prime[Range[1000]];rm=Rest[pr]+Most[pr];Table[Select[rm,Mod[#,pr[[n]]]==0&][[1]],{n,50}]
%t s = Total /@ Partition[Prime@ Range[10^4], 2, 1]; Table[SelectFirst[s, Divisible[#, Prime@ n] &], {n, 52}] (* _Michael De Vlieger_, Jul 04 2017 *)
%o (PARI) a(n)=p = 2; pn = prime(n); forprime(q=3, , if (((s=p+q) % pn) == 0, return (s)); p = q;); \\ _Michel Marcus_, Jul 04 2017
%o (PARI) isA001043(n)=precprime((n-1)/2)+nextprime(n/2)==n&&n>2
%o a(n,p=prime(n))=if(p==5, return(5)); my(k=2); while(!isA001043(k*p), k+=2); k*p \\ _Charles R Greathouse IV_, Jul 05 2017
%Y Cf. A001043, A062703, A111163, A247245, A247252, A188815 (the smaller prime), A118134.
%K nonn
%O 1,1
%A _Zak Seidov_, Jan 06 2012