This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A051935 #46 Apr 24 2023 12:13:33 %S A051935 2,3,6,8,10,12,18,20,22,26,30,34,36,42,44,46,50,52,60,66,72,74,76,78, %T A051935 80,82,102,108,114,116,118,126,128,132,136,138,144,146,150,154,158, %U A051935 162,166,170,174,186,196,198,210,222,228,236,240,244,246,254,270,280,282 %N A051935 a(n) = smallest number > a(n-1) such that a(1) + a(2) + ... + a(n) is a prime. %H A051935 David A. Corneth, <a href="/A051935/b051935.txt">Table of n, a(n) for n = 1..10000</a> (first 2000 terms from T. D. Noe) %H A051935 Code Golf StackExchange, <a href="https://codegolf.stackexchange.com/questions/170787/compute-the-minimum-anan-1-such-that-a1a2-dotsan-is-prime/254197">Compute the minimum a(n)>a(n-1) such that a(1)+a(2)+ ... +a(n) is prime</a>, coding challenge started Aug 17 2018. %e A051935 The third term is 6 because 2 + 3 + 6 = 11 is a prime. %t A051935 p=2;lst={p};Do[If[PrimeQ[p+n], AppendTo[lst, n];p=p+n], {n, 3, 10^3}];lst (* _Vladimir Joseph Stephan Orlovsky_, Aug 14 2008 *) %t A051935 nxt[{t_,a_}]:=Module[{k=a+1},While[!PrimeQ[t+k],k++];{t+k,k}]; Transpose[ NestList[ nxt,{2,2},60]][[2]] (* _Harvey P. Dale_, Apr 10 2016 *) %t A051935 nxt[{t_,a_}]:=Module[{k=a+1},k=NextPrime[t+k-1]-t;{t+k,k}]; NestList[ nxt,{2,2},60][[All,2]] (* More efficient than the program immediately above *) (* _Harvey P. Dale_, Aug 26 2019 *) %o A051935 (Perl) use ntheory ":all"; my($s,@L)=(2,2); for (1..99) { push @L, next_prime($s+$L[-1])-$s; $s+=$L[-1]; } print "[@L]\n"; # _Dana Jacobsen_, Sep 25 2018 %o A051935 (PARI) first(n) = {my(res = vector(n), os = 2, ns); res[1] = 2; for(i = 2, n, ns = nextprime(os + res[i-1] + 1); res[i] = ns - os; os = ns); res} \\ _David A. Corneth_, Aug 26 2019 %o A051935 (Python) %o A051935 from sympy import isprime %o A051935 from itertools import islice %o A051935 def agen(): # generator of terms %o A051935 yield from [2, 3] %o A051935 s, an = 5, 4 %o A051935 while True: %o A051935 while not isprime(s+an): an += 2 %o A051935 yield an %o A051935 an, s = an+2, s+an %o A051935 print(list(islice(agen(), 60))) # _Michael S. Branicky_, Oct 30 2022 %Y A051935 Cf. A051934, A078706, A360061. %K A051935 easy,nice,nonn %O A051935 1,1 %A A051935 _Felice Russo_, Dec 21 1999