OFFSET
8,1
COMMENTS
The widest prime pair with a mean of n is (A002373(n),A020482(n)) and the narrowest is (A078587(n),A078496(n)).
Existence of a(n) for all n depends on A061357(n) > 0.
Even numbers missing in the subsequence with n<10^5 are 34,62,82,88,112,116,118,122,130,140,152...
a(n) = 0 for n=4,5,6,7,19 because A061357(n) = 1.
LINKS
Ralf Stephan, Table of n, a(n) for n = 8..100000
EXAMPLE
The prime pairs with an arithmetic mean of 18 are (17,19), (13,23), (7,29), and (5,31), so a(18) = 17-5 = 31-19 = 12. The only pair with mean of 19 is (7,31) so a(19) = 0.
PROG
(PARI) a(n)=mi=0; ma=0; forprime(p=3, n-1, if(isprime(2*n-p), if(!mi, mi=2*n-p); ma=2*n-p)); if(!ma, -1, mi-ma)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ralf Stephan, Dec 29 2013
STATUS
approved