OFFSET
1,3
EXAMPLE
There are no primes before prime(1) so a(1) = 1.
a(3) = 3 as prime(3) = 5, which is the arithmetic mean of the three consecutive primes {3, 5, 7}.
PROG
(PARI) a(n) = {my(s = pprev = pnxt = p = prime(n), q=1); for(i=1, n-1, pprev = precprime(pprev - 1); pnxt = nextprime(pnxt + 1); s += (pprev + pnxt); q += 2; if(p * q == s, return(q))); return(1)}
CROSSREFS
KEYWORD
nonn
AUTHOR
David A. Corneth, Oct 14 2017
STATUS
approved