OFFSET
0,1
COMMENTS
Or, smallest (2n+1)-balanced prime number.
Prime(k) is a balanced prime of order n if it is the average of the 2n+1 primes from prime(k-n) to prime(k+n).
LINKS
Giovanni Resta, Table of n, a(n) for n = 0..10000 (first 1375 terms from Robert G. Wilson v)
EXAMPLE
a(1) = 5 = (3 + 5 + 7)/3 = 15/3.
a(5) = 53 = (31 + 37 + 41 + 43 + 47 + 53 + 59 + 61 + 67 + 71 + 73)/11 = 583/11.
a(6) = 71 = (43 + 47 + 53 + 59 + 61 + 67 + 71 + 73 + 79 + 83 + 89 + 97 + 101)/13 = 923/13.
MATHEMATICA
f[n_] := Block[{p = Prime@ Range[2n +1]}, While[ Total[p] != (2n +1) p[[n +1]], p = Join[Rest@ p, {NextPrime[ p[[-1]]] }]]; p[[n +1]]]; Array[f, 46, 0] (* Robert G. Wilson v, Jun 21 2004 and modified Apr 11 2017 *)
PROG
(PARI) for(n=1, 50, i=2*n+1:f=0:forprime(p=2, 10^7, s=0:c=i:pr=p-1:t=0:while(c>0, c=c-1:pr=nextprime(pr+1):s=s+pr: if(c==(i-1)/2, t=pr)): if(s/i==t, print1(t", "):f=1:break)): if(!f, print1("0, ")))
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Apr 08 2003
EXTENSIONS
Corrected and extended by Ralf Stephan, Apr 09 2003
STATUS
approved