OFFSET
4,1
COMMENTS
Goldbach's weak (ternary) conjecture states that every odd number > 5 can be expressed as the sum of three primes (see link). This sequence applies the conjecture (now proven) to primes > 5. From all possible partitions of prime(n) = p+q+r for primes p,q,r (p <= q <= r), a(n) is chosen as the least possible value of the greatest prime r (with lower prime p not constrained to be A302607(prime(n)). The sequence is not strictly increasing, and although many primes appear repeatedly, some do not appear at all (e.g. 59 is not included).
LINKS
EXAMPLE
The partition of prime(5)=11 into 3 primes p <= q <= r is 11=3+3+5 and since no smaller value than 5 can be attributed to r, a(5)=5.
PROG
(PARI) a(n) = {my(pn = prime(n), res = oo); forprime(p=2, pn, forprime(q=p, pn, forprime(r=q, pn, if (p+q+r == pn, res = min(res, r)); ); ); ); res; } \\ Michel Marcus, May 13 2018
(PARI) first(n) = {n = prime(n + 3); my(strt = vector(n, i, i), t = 0, res = vector(primepi(n) - 3)); forprime(p = 2, n, forprime(q = p, n - p, forprime(r = q, n - p - q, strt[p + q + r] = min(r, strt[p + q + r])))); forprime(p = 7, n, t++; res[t] = strt[p]); res} \\ David A. Corneth, May 14 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Apr 12 2018
STATUS
approved