OFFSET
2,1
COMMENTS
a(n) is the greatest k such that 2*s(n) >= s(n+k), where s(n) is the n-th partial sum of primes.
FORMULA
a(n) = A231153(n) + 1.
EXAMPLE
5 <= 2 + 3 < 5 + 7, so a(2) = 2.
19 + 23 <= 2 + 3 + 5 + 7 + 11 + 13 + 17 < 19 + 23 + 27, so a(7) = 3.
MATHEMATICA
test = 0; u = Table[test = test + Prime[n]; tmp = 0; NestWhile[# + 1 &, n, test >= (tmp = tmp + Prime[#]) &] - n, {n, 1, 80}]; u + 1 (* Peter J. C. Moses, Nov 02 2013 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Nov 09 2013
STATUS
approved