%I #11 May 05 2022 07:18:52
%S 1,1,1,2,2,3,3,4,6,7,7,8,8,9,11,12,12,13,13,14,16,17,17,18,20,23,25,
%T 26,26,27,27,28,30,33,35,36,36,37,39,40,40,41,41,42,44,45,45,46,48,51,
%U 53,54,54,55,57,60,62,63,63,64,64,65,67,70,72,73,73,74,76,77,77,78,78,79
%N a(n) = Sum_{k=1..n} A051699(k).
%H Amiram Eldar, <a href="/A072926/b072926.txt">Table of n, a(n) for n = 1..10000</a>
%F Conjecture: a(n) is asymptotic to C*n*log(n) with C = 0.29... .
%t f[n_] := If[PrimeQ[n], 0, Min[NextPrime[n] - n, n - NextPrime[n, -1]]]; Accumulate[Table[f[n], {n, 1, 100}]] (* _Amiram Eldar_, May 05 2022 *)
%o (PARI) a(n)=sum(k=1,n,vecmin(vector(k,i,abs(k-prime(i)))))
%Y Cf. A051699.
%K nonn
%O 1,4
%A _Benoit Cloitre_, Aug 11 2002