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 A366092 #20 Oct 03 2023 10:33:52 %S A366092 2,0,0,1,0,1,0,1,2,1,2,3,0,1,0,3,2,1,2,1,2,3,4,3,4,1,2,5,2,1,4,1,4,1, %T A366092 2,3,4,5,2,3,2,5,2,1,2,1,2,3,2,1,2,1,2,3,2,1,2,1,10,1,0,11,2,1,0,3,2, %U A366092 3,2,7,2,1,2,3,4,3,2,3,4,5,2,5,4,3,10,3 %N A366092 Distance from the sum of the first n primes to the nearest prime. %C A366092 Positions of zeros are given by A013916. %C A366092 Positions of records are given by A366093. %H A366092 Paolo Xausa, <a href="/A366092/b366092.txt">Table of n, a(n) for n = 0..10000</a> %F A366092 a(n) = A051699(A007504(n)). %F A366092 a(n) = abs(A007504(n) - A366094(n)). %e A366092 a(3) = 1 because the sum of the first 3 primes is 2 + 3 + 5 = 10, the nearest prime is 11 and 11 - 10 = 1. %t A366092 pDist[n_]:=If[PrimeQ[n],0,Min[NextPrime[n]-n,n-NextPrime[n,-1]]]; %t A366092 A366092list[nmax_]:=Map[pDist,Prepend[Accumulate[Prime[Range[nmax]]],0]]; %t A366092 A366092list[100] %o A366092 (Python) %o A366092 from sympy import prime, nextprime, prevprime %o A366092 def A366092(n): return min((m:=sum(prime(i) for i in range(1,n+1)))-prevprime(m+1),nextprime(m)-m) if n else 2 # _Chai Wah Wu_, Oct 03 2023 %Y A366092 Cf. A000040, A007504, A013916, A051699, A366093, A366094. %Y A366092 Cf. also A351830, A354330. %K A366092 nonn,easy %O A366092 0,1 %A A366092 _Paolo Xausa_, Sep 29 2023