OFFSET
1,1
COMMENTS
a(n) = largest prime p such that prime(n) = (p+q)/2, where q is also prime.
prime(n) <= a(n) < 2*prime(n).
Conjecture: a(n) = prime(n) only for n = 1 and 2.
FORMULA
a(n) = 2*prime(n) - A092938(n).
EXAMPLE
2*prime(18) = 122; the primes smaller than 122 are 113, 109, 107, ... in descending order. 122 - 113 = 9 is not prime, but 122 - 109 = 13 is prime, hence a(18) = 109.
PROG
(PARI) {for(n=1, 56, k=2*prime(n); q=2; while(!isprime(p=k-q), q=nextprime(q+1)); print1(p, ", "))} - Klaus Brockhaus, Dec 23 2006
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Mar 23 2004
EXTENSIONS
Edited and extended by Klaus Brockhaus, Dec 23 2006
STATUS
approved