A303603 a(n) is the maximum distance between primes in Goldbach partitions of 2n, or 2n if there are no Goldbach partitions of 2n.
0, 0, 0, 2, 4, 2, 8, 10, 8, 14, 16, 14, 20, 18, 16, 26, 28, 26, 24, 34, 32, 38, 40, 38, 44, 42, 40, 50, 48, 46, 56, 58, 56, 54, 64, 62, 68, 70, 68, 66, 76, 74, 80, 78, 76, 86, 84, 82, 60, 94, 92, 98, 100, 98, 104, 106, 104, 110, 108, 106, 96, 102, 100, 90, 124, 122, 128, 126, 124, 134, 136, 134, 132
Offset: 1
Keywords
Examples
a(1) = 0 for coherence with other related sequences. a(2) = 0 because 2 * 2 = 4 = 2 + 2 and max_diff = 2 - 2 = 0. a(8) = 10 because 2 * 8 = 16 = 5 + 11 = 3 + 13 and max_diff = 13 - 3 = 10.
Links
- Seiichi Manyama, Table of n, a(n) for n = 1..10000
- Marcin Barylski, C++ program
- Marcin Barylski, Maximum distance for even numbers < 10^6
- Eric Weisstein's MathWorld, Goldbach Partition
Programs
-
Mathematica
a[1]=a[2]=0; a[n_]:=Module[{p=3},While[PrimeQ[2*n-p]!=True,p=NextPrime[p]];2*(n-p)]; a/@Range[73] (* Ivan N. Ianakiev, Jun 27 2018 *)
-
PARI
a(n) = if (n==1, 0, forprime(p=2, , if (isprime(2*n-p), return (2*n-2*p)))); \\ Michel Marcus, Jul 02 2018
Formula
a(n) = 2 * A047949(n) if A047949(n) > 0 for n >= 2; a(n) = 2n if A047949(n) = -1. - Alois P. Heinz, Jun 01 2020
Comments