%I #24 Oct 21 2020 23:05:53
%S 0,2,0,3,6,15,5,16,25,3,20,39,13,36,61,17,50,6,39,76,14,53,102,28,75,
%T 132,46,101,158,46,99,174,64,145,27,114,193,51,144,239,93,194,24,135,
%U 244,74,179,294,116,253,43,162,291,61,196,337,101,250,395,139,282,427,149,324
%N The smallest possible nonnegative difference between the sum of the first n primes (A007504) and the sum of any number of the directly following and consecutive primes.
%C Conjecture: a(0)=0, a(2)=0 and a(532)=0 are the only zeros in the sequence. a(n) has been computed for primes < 10^10. - _Bob Andriesse_, Oct 07 2020
%e a(2) = 2 + 3 - 5 = 0;
%e a(3) = 2 + 3 + 5 - 7 = 3;
%e a(6) = 2 + 3 + 5 + 7 + 11 + 13 - (17 + 19) = 5.
%e a(532)=0 because A007504(733) = 2*A007504(532).
%o (Python)
%o #Lists a(1)...a(100)
%o from sympy import prime
%o sumP=0
%o for i in range(1,101):
%o sumP+=prime(i)
%o j=i+1
%o diff=sumP
%o while diff-prime(j) >=0:
%o diff-=prime(j)
%o j+=1
%o print diff,',',
%Y Cf. A007504, A309714.
%K nonn
%O 0,2
%A _Bob Andriesse_, Aug 11 2019
|