OFFSET
1,1
COMMENTS
A number p is representable as the arithmetic mean of two other primes in n ways if there are n values of k such that p + k and p - k are both prime.
If the restriction that a(n) must be greater than previous terms is removed then the sequence would be A126204. - Andrew Howroyd, Jan 12 2020
The next term if it exists > 10^6. - Andrew Howroyd, Jan 12 2020
EXAMPLE
a(1) = 5 because 5+-2 are primes.
a(2) = 11 because 11+-6, 11+-8 are primes.
a(3) = 17 because 17+-6, 17+-12, 17+=14 are primes.
a(4) = 37 because 37+-6, 37+-24, 37+-30, 37+-34 are primes.
a(5) = 53 because 53+-6, 53+-30, 53+-36, 53+-48, 53+-50 are primes.
MATHEMATICA
q=1; lst={}; Do[p=Prime[n]; i=0; Do[If[PrimeQ[p-k]&&PrimeQ[p+k], i++; ], {k, 2, p, 2}]; If[i==q, AppendTo[lst, p]; q++ ], {n, 2*5!}]; lst
PROG
(PARI) a(n, lim=oo)={my(v=vector(n), r=1); forprime(p=5, lim, my(k=0); forprime(q=3, p-2, k+=isprime(2*p-q)); if(k==r, if(r==n, return(p)); r++))} \\ Andrew Howroyd, Jan 12 2020
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Vladimir Joseph Stephan Orlovsky, Mar 01 2009
EXTENSIONS
Definition clarified by Andrew Howroyd, Jan 12 2020
STATUS
approved