A203836 Smallest sum s of two consecutive primes such that s = 0 mod prime(n).
8, 12, 5, 42, 198, 52, 68, 152, 138, 696, 186, 222, 410, 172, 564, 1272, 472, 1220, 268, 852, 1460, 2212, 1494, 712, 1164, 1818, 618, 1284, 872, 2486, 508, 786, 548, 1668, 1192, 906, 3768, 978, 668, 6228, 3222, 6516, 3820, 772, 4728, 3980, 6330, 892, 5448, 1374
Offset: 1
Keywords
Examples
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.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Programs
-
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 *)
-
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
Formula
a(n) = 4*prime(n) if prime(n) is in A118134. - Robert Israel, May 25 2020
Comments