login
Primes q such that p = (r+q+s-1)/2 is a balanced prime, where r, q, s are consecutive primes.
3

%I #8 Oct 10 2024 18:20:23

%S 397,1277,2939,4217,10211,11657,13049,17117,17791,19507,23117,25913,

%T 31259,36523,42677,44777,45659,49711,54499,56701,63521,64283,73877,

%U 74573,85093,88609,89477,89759,90059,93563,104161,104831,106937,108179

%N Primes q such that p = (r+q+s-1)/2 is a balanced prime, where r, q, s are consecutive primes.

%C The primes p arising here are in A129191.

%C q need not be a balanced prime, see however A129241.

%H Harvey P. Dale, <a href="/A129190/b129190.txt">Table of n, a(n) for n = 1..1000</a>

%e 389, 397, 401 are consecutive primes. 593 = (389+397+401-1)/2 = A006562(10) is a balanced prime, it is the average of the preceding prime 587 and the next prime 599. Hence 397 is a term.

%t bpQ[{r_,q_,s_}]:=Module[{p=(r+q+s-1)/2},PrimeQ[p]&&Mean[{NextPrime[p],NextPrime[p,-1]}]==p]; Select[Partition[Prime[Range[ 11000]],3,1],bpQ][[;;,2]] (* _Harvey P. Dale_, Oct 10 2024 *)

%o (Magma) [ q: q in PrimesInInterval(3, 110000) | IsPrime(p) and PreviousPrime(p)+NextPrime(p) eq 2*p where p is (PreviousPrime(q)+q+NextPrime(q)-1) div 2 ];

%Y Cf. A006562 (balanced primes), A127313, A129191, A129241.

%K nonn

%O 1,1

%A _Klaus Brockhaus_, Apr 05 2007