Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #10 Nov 20 2024 15:39:18
%S 491,617,757,1489,1787,2141,2143,2269,3529,3571,4723,5563,6337,6451,
%T 6659,6961,6991,7741,7873,7907,8821,10141,10267,10657,12911,13399,
%U 14629,15299,16189,16451,16487,17027,18223,18701,19801,19843,19853,19937
%N Central term of nine successive primes whose average is a prime.
%C The average value is not always the central term (see A096701).
%H Robert Israel, <a href="/A180457/b180457.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n)=[p(n-4)+p(n-3)+p(n-2)+p(n-1)+p(n)+p(n+1)+p(n+2)+p(n+3)+p(n+4)]/9.
%e a(5)=1787 since (1753+1759+1777+1783+1787+1789+1801+1811+1823)/9=16083/9=1787 a prime.
%p Primes:= select(isprime,[seq(t,t=1..10^5,2)]):
%p PSums:= ListTools[PartialSums](Primes):
%p Avgs:= [seq((PSums[i+9]-PSums[i])/9, i=1..nops(PSums)-9)]:
%p Pos:= select(t -> Avgs[t]::integer and isprime(Avgs[t]),[$1..nops(Avgs)]):
%p seq(Primes[Pos[i]+5],i=1..nops(Pos)); # _Robert Israel_, Apr 26 2016
%t Select[Partition[Prime[Range[2500]],9,1],PrimeQ[Mean[#]]&][[;;,5]] (* _Harvey P. Dale_, Nov 20 2024 *)
%Y Cf. A000040, A096701.
%K nonn
%O 1,1
%A _Carmine Suriano_, Sep 06 2010