login
Powers of 3 which are the average of two primes p and nextprime(p).
4

%I #11 Feb 11 2024 18:16:48

%S 9,81,387420489,3486784401,7509466514979724803946715958257547,

%T 147808829414345923316083210206383297601

%N Powers of 3 which are the average of two primes p and nextprime(p).

%H Ray Chandler, <a href="/A115988/b115988.txt">Table of n, a(n) for n = 1..13</a>

%e Nextprime(387420479) = 387420499 and (387420479 + 387420499)/2 = 387420489 = 3^18, so 387420489 belongs to the sequence.

%t Select[3^Range[100],#==Mean[{NextPrime[#],NextPrime[#,-1]}]&] (* _Harvey P. Dale_, Feb 11 2024 *)

%o (PARI) lista(nn) = for(k=1, nn, if(precprime(3^k-1)+nextprime(3^k+1)==2*3^k, print1(3^k, ", "))); \\ _Jinyuan Wang_, Feb 26 2020

%Y Cf. A115986, A115987, A115989.

%K nonn

%O 1,1

%A _Giovanni Resta_, Feb 10 2006