Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #38 Dec 10 2024 11:58:42
%S 3,16,37,40,47,55,56,74,103,108,111,119,130,161,165,185,188,195,200,
%T 219,240,272,273,292,340,359,388,420,427,465,466,509,521,554,600,606,
%U 622,630,634,668,683,684,703,710,711,734,762,792,814,822,823,830,831,883
%N Numbers k such that prime(k+1) + prime(k-1) = 2*prime(k).
%C The indices of primes that are equidistant from the two primes surrounding them. - _Harvey P. Dale_, May 16 2013
%C Indices of balanced primes (A006562). - _Zak Seidov_, Mar 03 2019
%H Harry J. Smith, <a href="/A066875/b066875.txt">Table of n, a(n) for n = 1..1000</a>
%F a(n) = primepi(A006562(n)) = A000720(A006562(n)).
%t Select[Range[2, 1000], Prime[ # ] == (Prime[ # + 1] + Prime[ # - 1])/2 &] (* _Ray Chandler_, Jan 09 2007 *)
%t PrimePi/@Transpose[Select[Partition[Prime[Range[900]],3,1],Length[ Union[ Differences[ #]]]==1&]][[2]] (* _Harvey P. Dale_, May 16 2013 *)
%o (PARI) isok(k) = { k > 1 && prime(k+1) + prime(k-1) == 2*prime(k) } \\ _Harry J. Smith_, Apr 03 2010
%o (Magma) [n: n in [2..1000] | 2*NthPrime(n) eq (NthPrime(n-1) + NthPrime(n+1))]; // _Vincenzo Librandi_, Apr 09 2015
%Y Cf. A000720 (primepi), A006562 (balanced primes).
%K nonn
%O 1,1
%A _Benoit Cloitre_, Jan 21 2002
%E Corrected by _Ray Chandler_, Jan 09 2007