OFFSET
4,1
COMMENTS
Suggested by Goldbach Conjecture.
Values of q from A143697. This follows from the factorization n^2-k^2 = (n-k)(n+k).
LINKS
P. CAMI, Table of n, a(n) for n = 4..60000
FORMULA
n>3 integer; a(n)=min{p: p>n; p, 2*n-p are primes}.
EXAMPLE
a(11)=17.
MATHEMATICA
Table[p=n+1; q=2n-p; While[q>0&&!(PrimeQ[p]&&PrimeQ[q]), p++; q-- ]; p, {n, 4, 100}]
PROG
(PARI) a(n) = {my(p=nextprime(n+1)); while(!isprime(2*n-p), p = nextprime(p+1)); p; } \\ Michel Marcus, Oct 22 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Serhat Sevki Dincer (sevki(AT)ug.bilkent.edu.tr), Nov 26 2002
EXTENSIONS
STATUS
approved