login
A078587
Largest prime p such that p<n and 2n-p is also prime.
9
3, 3, 5, 3, 5, 7, 7, 5, 11, 7, 11, 13, 13, 11, 17, 7, 17, 19, 13, 17, 19, 19, 23, 23, 19, 17, 29, 19, 23, 29, 31, 29, 31, 31, 29, 37, 37, 29, 41, 19, 41, 43, 31, 41, 43, 37, 47, 43, 43, 47, 47, 43, 53, 53, 43, 47, 59, 43, 53, 59, 61, 59, 61, 61, 53, 67, 67, 59, 71, 67, 59, 71
OFFSET
4,1
COMMENTS
Suggested by Goldbach Conjecture.
Also, values of p from A143697. This follows from the factorization n^2-k^2 = (n-k)(n+k). - T. D. Noe, Jan 22 2009
FORMULA
a(n) = 2n - A078496(n)
MATHEMATICA
Table[p=n+1; q=2n-p; While[q>0&&!(PrimeQ[p]&&PrimeQ[q]), p++; q-- ]; q, {n, 4, 100}]
PROG
(PARI) a(n) = {my(p = precprime(n-1)); while(!isprime(2*n-p), p = precprime(p-1)); p; } \\ Michel Marcus, Oct 22 2016
CROSSREFS
Cf. A082467.
Sequence in context: A204022 A131832 A255316 * A335074 A239931 A033558
KEYWORD
easy,nonn
AUTHOR
T. D. Noe, Dec 02 2002
EXTENSIONS
Edited by N. J. A. Sloane, Jan 24 2009 at the suggestion of R. J. Mathar and T. D. Noe.
STATUS
approved