OFFSET
1,1
COMMENTS
Besides a(3)=5, all terms are even and >=4. - Zak Seidov, Nov 29 2014
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = 4*prime(n) if prime(n) is in A118134. - Robert Israel, May 25 2020
EXAMPLE
a(1) = 8 = 3 + 5 is the least sum of two consecutive primes that is a multiple of prime(1) = 2.
a(3) = 5 = 2 + 3 is the least sum of two consecutive primes that is a multiple of prime(3) = 5.
MAPLE
N := 100: # for a(1)..a(N)
M := ithprime(N):
V := Vector(M):
count:= 0:
for i from 1 while count < N do
x:= ithprime(i)+ithprime(i+1);
Q:= convert(select(t -> t <= M and V[t]=0, numtheory:-factorset(x)), list);
V[Q]:= x;
count:= count + nops(Q);
od:
seq(V[ithprime(i)], i=1..N); # Robert Israel, May 25 2020
MATHEMATICA
pr=Prime[Range[1000]]; rm=Rest[pr]+Most[pr]; Table[Select[rm, Mod[#, pr[[n]]]==0&][[1]], {n, 50}]
s = Total /@ Partition[Prime@ Range[10^4], 2, 1]; Table[SelectFirst[s, Divisible[#, Prime@ n] &], {n, 52}] (* Michael De Vlieger, Jul 04 2017 *)
PROG
(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
(PARI) isA001043(n)=precprime((n-1)/2)+nextprime(n/2)==n&&n>2
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
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Jan 06 2012
STATUS
approved