login
a(n) is the smallest number that is the sum of both 2n-1 and 2n+1 consecutive primes.
3

%I #40 Mar 02 2019 03:02:01

%S 23,83,119,401,1025,3321,863,5683,1523,3397,3979,8983,7901,21775,

%T 11131,9073,14699,16277,30895,9167,15947,40091,105131,54923,14413,

%U 15605,122135,29775,173649,80841,99149,56495,189807,46421,290203,158741,56099,276535,189869

%N a(n) is the smallest number that is the sum of both 2n-1 and 2n+1 consecutive primes.

%H Giovanni Resta, <a href="/A213174/b213174.txt">Table of n, a(n) for n = 1..10000</a> (first 2449 terms from Robert G. Wilson v)

%e 23 = 5 + 7 + 11, 83 = 23 + 29 + 31 = 11 + 13 + 17 + 19 + 23,

%e 119 = 17 + 19 + 23 + 29 + 31 = 7 + 11 + 13 + 17 + 19 + 23 + 29.

%t pr = Prime[Range[1, 100]]; Table[{n, Intersection[(Plus @@@ Partition[pr, 2 n - 1, 1]),Plus @@@ Partition[pr, 2 n + 1, 1]][[1]]}, {n, 40}] (* or *)

%t S = Accumulate@ Prime@ Range@ 64000; Table[A = <||>; v = 0; Do[ A[S[[k + 2 n + 1]] - S[[k]]] = 0; t = S[[k + 2 n - 1]] - S[[k]]; If[KeyExistsQ[A, t], v = t; Break[]], {k, 64000 -2*n-1}]; If[v == 0, Break[], v], {n, 1000}] (* _Giovanni Resta_, Jun 08 2017 *)

%K nonn

%O 1,1

%A _Zak Seidov_, Mar 07 2013