login
A090303
Begin with n and consider numbers obtained by successively subtracting 2,3,5,7,11,...; a(n) = largest prime that arises, i.e., largest prime of the form n - sum prime(r), or 0 if no such prime exists.
1
0, 0, 0, 2, 3, 0, 5, 3, 7, 5, 0, 7, 11, 0, 13, 11, 7, 13, 17, 3, 19, 17, 13, 19, 23, 0, 17, 23, 19, 13, 29, 0, 31, 29, 7, 31, 0, 0, 37, 23, 31, 37, 41, 3, 43, 41, 37, 43, 47, 0, 41, 47, 43, 37, 53, 0, 47, 53, 31, 43, 59, 0, 61, 59, 37, 61, 0, 0, 67, 53, 61, 67, 71, 0, 73, 71, 67, 73, 2, 3
OFFSET
1,4
COMMENTS
a(p) = p-2 if p is larger member of a twin prime pair.
Conjecture: There are finitely many zeros in this sequence.
FORMULA
Largest prime of the form n - sum prime(r).
PROG
(PARI) a(n) = {p = 2; n -= p; while ((n > 0) && !isprime(n), p = nextprime(p+1); n -= p); max(0, n); } \\ Michel Marcus, Jul 29 2017
CROSSREFS
Cf. A090304.
Sequence in context: A080367 A354365 A066913 * A277516 A322333 A346615
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Nov 30 2003
EXTENSIONS
More terms from David Wasserman, Oct 27 2005
STATUS
approved