%I #39 May 20 2022 05:23:54
%S 1871,2141,2677,2777,2903,2963,3673,4969,5107,5417,6323,7487,10459,
%T 11173,11497,11689,14519,18047,18077,19081,19379,20357,20533,20611,
%U 21577,22619,25621,32621,34543,35531,36821,39089,39503,40111,40771,44263,44647,44917,51551,52181
%N Primes p such that Sum_{k=PreviousPrime(p)..p} d(k) = Sum_{k=p..NextPrime(p)} d(k), where d(k) is the number of divisors function A000005.
%C It doesn't matter if terms or the neighboring primes are included in the sums or excluded as long as the symmetry is taken into account.
%C If A133760(n) = A133760(n-1), then A000040(n) is a term.
%H Karl-Heinz Hofmann, <a href="/A353552/b353552.txt">Table of n, a(n) for n = 1..10000</a>
%e a(2) = 2141 (a prime); previous prime is 2137; next prime is 2143.
%e The numbers of divisors between are:
%e + d(2138) = 4 + d(2142) = 24
%e + d(2139) = 8
%e + d(2140) = 12
%e ------------------------------------------
%e sum = 24 sum = 24 Sums are equal. Thus 2141 is a term.
%t Select[Prime[Range[5000]], Total[DivisorSigma[0, Range[NextPrime[#, -1], #]]] == Total[DivisorSigma[0, Range[#, NextPrime[#]]]] &] (* _Amiram Eldar_, May 11 2022 *)
%o (Python)
%o from sympy import sieve as A000040, divisor_count as A000005
%o def sotsb(a,b): return sum(A000005(n) for n in range(a+1, b))
%o # sotsb stands for the "sum of taus strictly between (a and b)"
%o print([A000040[n] for n in range(2, 5400) if sotsb(A000040[n-1],A000040[n]) == sotsb(A000040[n],A000040[n+1])])
%o (PARI) isok(p) = isprime(p) && sum(k=precprime(p-1), p, numdiv(k)) == sum(k=p, nextprime(p+1), numdiv(k)); \\ _Michel Marcus_, May 11 2022
%Y Cf. A000005, A000040, A133760.
%Y Cf. A353553 (sum of three sets are equal), A353554 (sum of four sets are equal).
%K nonn
%O 1,1
%A _Karl-Heinz Hofmann_, May 10 2022
|