login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Slowest increasing sequence in which a(n) is a prime closest to the sum of all previous terms.
1

%I #9 Jun 17 2012 02:17:05

%S 2,2,3,7,13,29,53,109,223,439,881,1759,3517,7039,14071,28151,56299,

%T 112601,225217,450413,900821,1801669,3603317,7206631,14413253,

%U 28826519,57653027,115306073,230612149,461224289,922448587,1844897167,3689794321

%N Slowest increasing sequence in which a(n) is a prime closest to the sum of all previous terms.

%C Cf. A109278 fastest increasing sequence in which a(n) is a prime closest to the sum of all previous terms.

%e a(1)=2, sum(1)=2; prime closest to sum is 2, hence a(2)=2, sum(2)=4; there are two primes 3 and 5 closest to sum(2), we choose the smallest one, hence a(3)=3, sum(3)=7, etc.

%t s={2};su=2;Do[If[PrimeQ[su], a=su, pp=PrimePi[su];prv=Prime[pp];nxt=Prime[pp+1];a=If[su-prv>nxt-su, nxt, prv]];AppendTo[s, a];Print[a];su+=a, {i, 42}];s

%Y Cf. A109278.

%K nonn

%O 1,1

%A _Zak Seidov_, Jun 25 2005

%E Definition and comment clarified by _Jonathan Sondow_, Jun 16 2012