A222564 Least integer that is a sum of 2*k - 1 consecutive primes for k = 1..n.
2, 23, 83, 311, 28382041, 1128722657, 460787266801
Offset: 1
Examples
a(1) = 2; a(2) = 23 = 5 + 7 + 11; a(3) = 83 = 23 + 29 + 31 = 11 + 13 + 17 + 19 + 23; a(4) = 311 = 101 + 103 + 107 = 53 + 59 + 61 + 67 + 71 = 31 + 37 + 41 + 43 + 47 + 53 + 59.
Crossrefs
Cf. A222592.
Programs
-
Mathematica
pr = Prime[Range[1000]]; tu[n_]:=(Total /@ Partition[pr, n, 1]) Intersection[tu[3],tu[5],tu[7]][[1]] (* gives a(3) = 311 - Zak Seidov, Feb 27 2013*) a[n_] := If[n == 1, 2, Block[{t, w}, t = Table[{Total@(w = Prime@ Range@(2*i + 1)), w}, {i, n - 1}]; While[Length@Union[First /@ t] > 1 || ! PrimeQ@t[[1, 1]], t = Sort@t; w = NextPrime@t[[1, 2, -1]]; t[[1, 1]] += w - t[[1, 2, 1]]; t[[1, 2]] = Append[Rest@t[[1, 2]], w]]; t[[1, 1]]]]; Array[a, 4] (* Giovanni Resta, Feb 27 2013 *)
Extensions
a(6)-a(7) from Giovanni Resta, Feb 27 2013
Comments