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 A366094 #22 Oct 03 2023 10:34:13 %S A366094 2,2,5,11,17,29,41,59,79,101,127,157,197,239,281,331,379,439,499,569, %T A366094 641,709,787,877,967,1061,1163,1259,1373,1481,1597,1721,1847,1987, %U A366094 2129,2273,2423,2579,2749,2917,3089,3271,3449,3637,3833,4027,4229,4441,4663,4889 %N A366094 Least prime nearest to the sum of the first n primes. %H A366094 Paolo Xausa, <a href="/A366094/b366094.txt">Table of n, a(n) for n = 0..10000</a> %e A366094 a(3) = 11 because the sum of the first 3 primes is 2 + 3 + 5 = 10 and the nearest prime is 11. %e A366094 a(10) = 127 because the sum of the first 10 primes is 129, which is equidistant from the nearest primes (127 and 131), and 127 is the smaller one. %t A366094 pNearest[n_]:=If[PrimeQ[n],n,With[{np=NextPrime[n],pp=NextPrime[n,-1]},If[np-n<n-pp,np,pp]]]; %t A366094 A366094list[nmax_]:=Prepend[Map[pNearest,Accumulate[Prime[Range[nmax]]]],2]; %t A366094 A366094list[100] %o A366094 (Python) %o A366094 from sympy import prime, nextprime, prevprime %o A366094 def A366094(n): return (p if ((m:=sum(prime(i) for i in range(1,n+1)))<<1)-(p:=prevprime(m+1))<=(k:=nextprime(m)) else k) if n else 2 # _Chai Wah Wu_, Oct 03 2023 %Y A366094 Cf. A000040, A007504, A366092. %Y A366094 Cf. A353295, A354329. %K A366094 nonn,easy %O A366094 0,1 %A A366094 _Paolo Xausa_, Sep 29 2023