The OEIS is supported by the many generous donors to the OEIS Foundation.

 Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”). Other ways to Give
 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A112823 Greatest p less than or equal to n with p and q both prime, p+q = 2n. 10
 2, 3, 3, 5, 5, 7, 5, 7, 7, 11, 11, 13, 11, 13, 13, 17, 17, 19, 17, 19, 13, 23, 19, 19, 23, 23, 19, 29, 29, 31, 23, 29, 31, 29, 31, 37, 29, 37, 37, 41, 41, 43, 41, 43, 31, 47, 43, 37, 47, 43, 43, 53, 47, 43, 53, 53, 43, 59, 59, 61, 53, 59, 61, 59, 61, 67, 53, 67, 67, 71, 71, 73 (list; graph; refs; listen; history; text; internal format)
 OFFSET 2,1 COMMENTS Essentially the same as A002374, which is the main entry for this sequence. - Franklin T. Adams-Watters, Jan 25 2010 Well defined only under the assumption that the yet unproved Goldbach conjecture holds, which states that any even N = 2n > 2 has a decomposition as sum of two primes. - M. F. Hasler, May 03 2019 LINKS FORMULA a(n) = n - A047160(n). - Jason Kimberley, Aug 31 2011 a(n) = n if and only if n is prime, i.e., n in A000040. - M. F. Hasler, May 03 2019 EXAMPLE From M. F. Hasler, May 03 2019: (Start) For n = 2, the largest prime p <= n is p = 2, and q := 2n - p = 4 - 2 = 2 is also prime, whence a(2) = 2. We see that whenever n is prime, we will have a(n) = p = q = n. For n = 4, the largest prime p <= n is p = 3, and q := 2n - p = 8 - 3 = 5 is also prime, whence a(4) = p = 3. For n = 8, the largest prime less than n is p' = 7, but 2n - p' = 16 - 7 = 9 is not prime, so we have to go to the next smaller prime p = 5 and now q := 2n - p = 16 - 5 = 11 is also prime, whence a(8) = p = 5. (End) MATHEMATICA f[n_] := Block[{p = n/2}, While[ !PrimeQ[p] || !PrimeQ[n - p], p-- ]; p]; Table[ f[n], {n, 4, 146, 2}] PROG (PARI) a(n) = {my(p = precprime(n)); while (!isprime(2*n-p), p = precprime(p-1)); p; } \\ Michel Marcus, Oct 22 2016 (PARI) A112823(n)=forprime(q=n, 2*n, isprime(2*n-q)&&return(2*n-q)) \\ M. F. Hasler, May 03 2019 CROSSREFS Cf. A002374, A020481, A047160. Sequence in context: A167411 A340195 A340192 * A247176 A325163 A348538 Adjacent sequences: A112820 A112821 A112822 * A112824 A112825 A112826 KEYWORD nonn AUTHOR Robert G. Wilson v, Sep 05 2005 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified November 30 09:19 EST 2022. Contains 358438 sequences. (Running on oeis4.)