CoCalc Public Filesplaymath / stage12-Goldbach Conjecture / stage12-try to prove Goldbach Conjecture.ipynbOpen with one click!
Author: cody luo
Views : 23
Description: 2019-09-02, Cody Luo ([email protected]), a programmer who graduated from the University of Science and Technology of China, the webmaster of 2293.ml, gave a proof of Goldbach's Conjecture at github.com/a-boy/playmath (Sagemath Jupyter document), using the method of "distributing distinct prime factors", found and proved two concise inequalities.
Compute Environment: Ubuntu 20.04 (Default)

Try to Prove Goldbach's Conjecture

Cody Luo([email protected]) 2019-08-27 2019-09-01 2019-09-02 2021-04-01

Abstract: Goldbach Conjecture Inequality 1: gold(n) < prime_pi(n)+sigma(n,0)
gold(n): the min non-negative integer makes that both n-g and n+g are primes
prime_pi(n): the count of primes in 1..n
sigma(n,0): the count of n.divisors()

gold(n) < prime_pi(n), while n>344 gold(n) < prime_pi(n)*4395/3449751 ≈ prime_pi(n)*0.0013, while n>57989356

Goldbach Conjecture Inequality 2: gold(n) < prime_pi(prime_pi(n)+n)

Keywords: Goldbach Conjecture; Prime Gap Inequality; prime_pi(n); sigma(n,0)

Improved Goldbach's Conjecture : Except n=344; n=22,46; n=28,for any other positive integer n>1,there exists g, 0=<g<prime_pi(n), make that both n-g and n+g are primes. As n increase from 2 to a very big integer, the peaks of gold(n) appear more and more slowly. n>344, history_peak(gold(n))/prime_pi(n) rapidly decreasing from 75/68 (n=344) to 300/685 (n=5131),1794/189274 (n=2591107), 4395/3449751(n=57989356), ..., to a decimal approaching 0. limit(sup gold(n)/prime_pi(n),n,+oo) == 0

Define g:=gold(n) as the min non-negative integer makes that both n-g and n+g are primes. so that 2*n=(n-g)+(n+g)=p+q.

(gold(n),prime_pi(n),prime_pi(prime_pi(n)+n),n) (75,68,80, 344) ([9], 8, 10, 22) ([9], 9, 12, 28) ([15], 14,17, 46)

gold(n) < prime_pi(n)+8, while n>3

In [5]:
def golds(n): return [g for g in range(0,prime_pi(n)+8) if (is_prime(n-g) and is_prime(n+g))] #the slow algorithm to give glod(n): min non-negative integer make both `n-g` and `n+g` are primes def gold(n): g=0 while not((is_prime(n-g) and is_prime(n+g))): g+=1 return g """ return (g,step) g:the min non-negative integer make both `n-g` and `n+g` are primes step: the times of calling next_prime """ def xgold(n): g,step=0,0 p,q=n,n while not is_prime(p): step+=1 q=next_prime(q) g=q-n p=n-g return (g,step) golds_list=[(golds(n),prime_pi(n),n) for n in range(2,365) ] print(golds_list) for x in golds_list: if not x[0] or (x[0][0]>=x[1]): print(x)
[([0], 1, 2), ([0], 2, 3), ([1], 2, 4), ([0, 2], 3, 5), ([1], 3, 6), ([0, 4], 4, 7), ([3, 5], 4, 8), ([2, 4], 4, 9), ([3, 7], 4, 10), ([0, 6, 8], 5, 11), ([1, 5, 7], 5, 12), ([0, 6, 10], 6, 13), ([3, 9], 6, 14), ([2, 4, 8], 6, 15), ([3, 13], 6, 16), ([0, 6, 12, 14], 7, 17), ([1, 5, 11, 13], 7, 18), ([0, 12], 8, 19), ([3, 9], 8, 20), ([2, 8, 10], 8, 21), ([9, 15], 8, 22), ([0, 6], 9, 23), ([5, 7, 13], 9, 24), ([6, 12], 9, 25), ([3, 15], 9, 26), ([4, 10, 14, 16], 9, 27), ([9, 15], 9, 28), ([0, 12], 10, 29), ([1, 7, 11, 13, 17], 10, 30), ([0, 12], 11, 31), ([9, 15], 11, 32), ([4, 10, 14], 11, 33), ([3], 11, 34), ([6, 12, 18], 11, 35), ([5, 7, 17], 11, 36), ([0, 6], 12, 37), ([9, 15], 12, 38), ([2, 8], 12, 39), ([3], 12, 40), ([0, 12, 18], 13, 41), ([1, 5, 11, 19], 13, 42), ([0], 14, 43), ([3, 15], 14, 44), ([2, 8, 14, 16], 14, 45), ([15], 14, 46), ([0, 6], 15, 47), ([5, 11, 19], 15, 48), ([12, 18], 15, 49), ([3, 9, 21], 15, 50), ([8, 10, 20, 22], 15, 51), ([9, 15, 21], 15, 52), ([0, 6], 16, 53), ([7, 13, 17], 16, 54), ([12, 18], 16, 55), ([3, 15], 16, 56), ([4, 10, 14, 16], 16, 57), ([15, 21], 16, 58), ([0, 12], 17, 59), ([1, 7, 13, 19, 23], 17, 60), ([0, 18], 18, 61), ([9, 21], 18, 62), ([4, 10, 16, 20], 18, 63), ([3], 18, 64), ([6, 18, 24], 18, 65), ([5, 7, 13, 23], 18, 66), ([0, 6], 19, 67), ([15, 21], 19, 68), ([2, 10], 19, 69), ([3, 9], 19, 70), ([0, 12, 18], 20, 71), ([1, 11, 25], 20, 72), ([0, 6], 21, 73), ([15, 27], 21, 74), ([4, 8, 14, 22, 28], 21, 75), ([3], 21, 76), ([6, 24], 21, 77), ([5, 11, 19, 25], 21, 78), ([0, 18], 22, 79), ([9, 21, 27], 22, 80), ([2, 8, 20, 22, 28], 22, 81), ([15, 21], 22, 82), ([0, 24, 30], 23, 83), ([5, 13, 17, 23, 25], 23, 84), ([12, 18, 24], 23, 85), ([3, 15, 27], 23, 86), ([14, 16, 20, 26], 23, 87), ([9, 15, 21], 23, 88), ([0, 18], 24, 89), ([7, 11, 17, 19, 23], 24, 90), ([12, 18], 24, 91), ([9, 21], 24, 92), ([4, 10, 14, 20], 24, 93), ([15], 24, 94), ([6, 12], 24, 95), ([7, 13, 17], 24, 96), ([0, 30], 25, 97), ([9, 15], 25, 98), ([2, 10, 28, 32], 25, 99), ([3, 27], 25, 100), ([0, 12, 30], 26, 101), ([1, 5, 29], 26, 102), ([0, 6, 24], 27, 103), ([3, 33], 27, 104), ([2, 4, 8, 22, 26, 32, 34], 27, 105), ([3, 33], 27, 106), ([0, 6, 24], 28, 107), ([1, 5, 19, 29], 28, 108), ([0, 30], 29, 109), ([3, 21, 27], 29, 110), ([2, 28], 29, 111), ([15], 29, 112), ([0, 24], 30, 113), ([13, 17, 25, 35], 30, 114), ([12, 36], 30, 115), ([15, 33], 30, 116), ([10, 14, 20, 34], 30, 117), ([9, 21], 30, 118), ([12, 18, 30], 30, 119), ([7, 11, 17, 19, 31, 37], 30, 120), ([18], 30, 121), ([9, 15], 30, 122), ([14, 16, 26, 34], 30, 123), ([15, 27], 30, 124), ([12, 24], 30, 125), ([13, 23, 25, 37], 30, 126), ([0, 24, 30], 31, 127), ([21], 31, 128), ([2, 20, 22, 28], 31, 129), ([21, 27, 33], 31, 130), ([0, 18], 32, 131), ([5, 19, 25, 31, 35], 32, 132), ([6, 24, 30], 32, 133), ([3, 33], 32, 134), ([4, 22, 28, 32, 38], 32, 135), ([27], 32, 136), ([0, 30, 36], 33, 137), ([1, 11, 25, 29, 35], 33, 138), ([0, 12], 34, 139), ([9, 27, 33, 39], 34, 140), ([10, 32, 38, 40], 34, 141), ([15, 39], 34, 142), ([6, 30, 36], 34, 143), ([5, 7, 13, 35, 37], 34, 144), ([6, 18, 36], 34, 145), ([33], 34, 146), ([10, 16, 20, 34], 34, 147), ([9], 34, 148), ([0, 18, 42], 35, 149), ([1, 13, 23, 41], 35, 150), ([0, 12, 42], 36, 151), ([15, 21, 39], 36, 152), ([4, 14, 26, 40], 36, 153), ([3, 27], 36, 154), ([18, 24, 42], 36, 155), ([7, 17, 25, 43], 36, 156), ([0, 6], 37, 157), ([9, 21], 37, 158), ([8, 20, 22, 32], 37, 159), ([3, 21, 33], 37, 160), ([12, 30], 37, 161), ([5, 11, 31, 35], 37, 162), ([0, 36], 38, 163), ([15, 27, 33], 38, 164), ([2, 8, 14, 16, 26, 28, 34], 38, 165), ([15, 27], 38, 166), ([0, 30], 39, 167), ([5, 11, 29, 31], 39, 168), ([12, 30, 42], 39, 169), ([3, 21], 39, 170), ([8, 20, 22, 40], 39, 171), ([9, 21], 39, 172), ([0, 6, 24], 40, 173), ([7, 17, 23, 25, 37], 40, 174), ([18, 24, 36], 40, 175), ([3], 40, 176), ([4, 14, 20, 46], 40, 177), ([15, 21], 40, 178), ([0, 12, 48], 41, 179), ([1, 13, 17, 31, 43], 41, 180), ([0, 18, 30, 42], 42, 181), ([9, 15, 45], 42, 182), ([10, 16, 44, 46], 42, 183), ([27, 45], 42, 184), ([6, 12, 48], 42, 185), ([5, 7, 13, 37, 47], 42, 186), ([6, 24, 36], 42, 187), ([9, 39], 42, 188), ([8, 10, 22, 38, 40], 42, 189), ([9, 33, 39], 42, 190), ([0, 42], 43, 191), ([1, 19, 35, 41], 43, 192), ([0, 30, 36], 44, 193), ([3, 45], 44, 194), ([2, 4, 16, 28, 32, 38, 44, 46], 44, 195), ([3, 15, 33, 45], 44, 196), ([0, 30], 45, 197), ([1, 25, 31, 35, 41], 45, 198), ([0, 42], 46, 199), ([27, 33, 51], 46, 200), ([10, 22, 28, 38, 50], 46, 201), ([9, 21, 39], 46, 202), ([24, 30, 36], 46, 203), ([7, 23, 25, 37, 47, 53], 46, 204), ([6, 24], 46, 205), ([27, 33], 46, 206), ([16, 26, 34, 44, 50], 46, 207), ([15], 46, 208), ([18, 30, 42], 46, 209), ([13, 17, 19, 29, 31, 47, 53], 46, 210), ([0, 12, 18, 30], 47, 211), ([15, 21, 39, 45], 47, 212), ([14, 16, 20, 50], 47, 213), ([15], 47, 214), ([18, 24, 36, 42, 48], 47, 215), ([17, 23, 25, 35, 53], 47, 216), ([6, 24, 54], 47, 217), ([21, 39, 45, 51], 47, 218), ([8, 20, 22, 38, 52], 47, 219), ([9, 21], 47, 220), ([30, 42, 48], 47, 221), ([11, 29, 41, 49], 47, 222), ([0], 48, 223), ([27, 33, 45], 48, 224), ([2, 14, 26, 32, 44, 46, 52], 48, 225), ([3, 15, 45], 48, 226), ([0, 30, 36, 54], 49, 227), ([1, 5, 29, 35, 49, 55], 49, 228), ([0, 48], 50, 229), ([3, 33, 39, 51], 50, 230), ([2, 8, 20, 32, 38, 40, 50, 52], 50, 231), ([9, 39, 51], 50, 232), ([0, 6, 36], 51, 233), ([5, 7, 23, 35, 37, 43], 51, 234), ([6, 36, 42], 51, 235), ([3, 45, 57], 51, 236), ([4, 14, 26, 40, 44, 46, 56], 51, 237), ([39, 45], 51, 238), ([0, 12, 42], 52, 239), ([1, 11, 17, 29, 41, 43], 52, 240), ([0, 30, 42], 53, 241), ([9, 15, 51], 53, 242), ([14, 20, 50], 53, 243), ([33], 53, 244), ([6, 12, 18, 48], 53, 245), ([5, 17, 23, 35, 47], 53, 246), ([24, 36], 53, 247), ([9, 15, 21], 53, 248), ([8, 20, 22, 58], 53, 249), ([21, 27, 57], 53, 250), ([0, 12, 18, 60], 54, 251), ([11, 19, 25, 29, 41, 55, 59, 61], 54, 252), ([24, 30, 54, 60], 54, 253), ([3, 15, 27, 57], 54, 254), ([14, 16, 22, 26, 28, 56, 58], 54, 255), ([15, 27, 57], 54, 256), ([0, 6, 24, 60], 55, 257), ([19, 25, 35, 59], 55, 258), ([18, 48], 55, 259), ([3, 9, 21, 33], 55, 260), ([10, 20, 22, 32, 50], 55, 261), ([21, 51], 55, 262), ([0, 6, 30], 56, 263), ([7, 13, 53], 56, 264), ([42], 56, 265), ([3, 15, 27], 56, 266), ([4, 10, 16, 26, 40, 44], 56, 267), ([39, 45], 56, 268), ([0, 12, 42], 57, 269), ([1, 7, 13, 37, 41, 43, 47], 57, 270), ([0, 42, 60], 58, 271), ([9, 21, 39, 45], 58, 272), ([4, 10, 34, 40, 44], 58, 273), ([3, 33, 63], 58, 274), ([6, 18, 36, 42], 58, 275), ([5, 7, 35, 37], 58, 276), ([0, 6, 36, 54], 59, 277), ([15, 39], 59, 278), ([2, 28, 38, 52], 59, 279), ([3, 51, 57], 59, 280), ([0, 12, 30], 60, 281), ([1, 11, 25, 31, 49, 55], 60, 282), ([0, 54], 61, 283), ([27, 33], 61, 284), ([8, 22, 28, 46, 52, 62], 61, 285), ([45, 63], 61, 286), ([6, 24, 30, 60], 61, 287), ([5, 19, 25, 49, 59, 61, 65], 61, 288), ([18, 48, 60], 61, 289), ([21, 27, 57, 63], 61, 290), ([20, 22, 40, 58, 62, 68], 61, 291), ([15, 21], 61, 292), ([0, 24, 54, 60, 66], 62, 293), ([13, 17, 23, 37, 43, 53, 55, 65], 62, 294), ([12, 18, 54], 62, 295), ([15, 57, 63], 62, 296), ([14, 16, 20, 34, 40, 56], 62, 297), ([15, 69], 62, 298), ([18, 48, 60], 62, 299), ([7, 17, 31, 37, 49, 59, 67], 62, 300), ([30], 62, 301), ([9, 45, 51], 62, 302), ([10, 34, 46, 64], 62, 303), ([27, 33, 63], 62, 304), ([12, 42, 48, 54], 62, 305), ([25, 43, 67], 62, 306), ([0, 24, 30, 66], 63, 307), ([39, 45, 51], 63, 308), ([2, 28, 38, 40, 58, 70], 63, 309), ([3, 27, 39, 69], 63, 310), ([0, 42, 48], 64, 311), ([1, 5, 19, 35, 41, 55, 61, 71], 64, 312), ([0, 36], 65, 313), ([3, 33, 45], 65, 314), ([2, 22, 32, 34, 38, 44, 52, 58, 64], 65, 315), ([33], 65, 316), ([0, 36, 66], 66, 317), ([35, 41, 49, 55, 61], 66, 318), ([12, 48], 66, 319), ([27, 39, 63, 69], 66, 320), ([10, 28, 38, 52, 58], 66, 321), ([9, 15, 45, 51], 66, 322), ([30, 60, 66], 66, 323), ([7, 13, 43, 55, 73], 66, 324), ([12, 42, 48, 54], 66, 325), ([33, 57, 63], 66, 326), ([10, 20, 46, 56, 70], 66, 327), ([21, 45, 51], 66, 328), ([18, 60, 72], 66, 329), ([17, 19, 23, 37, 49, 53, 59, 67], 66, 330), ([0, 18, 48], 67, 331), ([15, 21, 51, 69], 67, 332), ([16, 20, 26, 40, 50, 56, 64], 67, 333), ([3, 63], 67, 334), ([18, 24, 54, 66], 67, 335), ([23, 43, 53, 65, 73], 67, 336), ([0, 30, 60], 68, 337), ([21, 45], 68, 338), ([8, 28, 58, 62, 70], 68, 339), ([9, 27, 33, 57, 69], 68, 340), ([48, 60], 68, 341), ([5, 11, 25, 31, 59], 68, 342), ([6, 30, 36, 66], 68, 343), ([75], 68, 344), ([8, 14, 28, 34, 38, 52, 64, 74], 68, 345), ([33, 63, 75], 68, 346), ([0, 36, 54], 69, 347), ([1, 11, 31, 35, 41, 71], 69, 348), ([0, 18, 72], 70, 349), ([3, 33, 39, 69], 70, 350), ([2, 38, 58, 68, 70], 70, 351), ([15, 21, 45, 69], 70, 352), ([0, 6, 36], 71, 353), ([5, 43, 47, 77], 71, 354), ([18, 24, 42, 78], 71, 355), ([3, 45, 63, 75], 71, 356), ([10, 26, 40, 44, 64, 74, 76], 71, 357), ([9, 21, 51, 75], 71, 358), ([0, 42], 72, 359), ([7, 13, 23, 29, 49, 79], 72, 360), ([12, 48, 78], 72, 361), ([69], 72, 362), ([4, 10, 16, 26, 46, 56, 70], 72, 363), ([15, 33, 57], 72, 364)] ([9, 15], 8, 22) ([9, 15], 9, 28) ([15], 14, 46) ([75], 68, 344)
In [2]:
# check Improved Goldbach's Conjecture @interact def check_Improved_Goldbach_Conjecture(n=(2..1024)): print (xgold(n),prime_pi(n),sigma(n,0),prime_pi(prime_pi(n)+n))
In [4]:
# sage verify.sage # verify Improved Goldbach's Conjecture n=344 g,step=xgold(n) print(n,xgold(n),prime_pi(n),sigma(n,0),prime_pi(prime_pi(n)+n)) n=2 g,step=xgold(n) peak=g while peak<1794: if(g>=peak): peak=g print(n,(g,step),prime_pi(n),sigma(n,0),prime_pi(prime_pi(n)+n)) n+=1 g,step=xgold(n)
344 (75, 13) 68 8 80 2 (0, 0) 1 2 2 3 (0, 0) 2 2 3 4 (1, 1) 2 3 3 6 (1, 1) 3 4 4 8 (3, 1) 4 4 5 10 (3, 2) 4 4 6 14 (3, 1) 6 4 8 16 (3, 2) 6 5 8 20 (3, 1) 8 6 9 22 (9, 3) 8 4 10 28 (9, 3) 9 6 12 32 (9, 2) 11 6 14 38 (9, 3) 12 4 15 46 (15, 4) 14 4 17 58 (15, 5) 16 4 21 68 (15, 4) 19 6 23 74 (15, 3) 21 4 24 82 (15, 3) 22 4 27 94 (15, 5) 24 4 30 112 (15, 2) 29 10 34 116 (15, 2) 30 6 34 121 (18, 4) 30 3 36 128 (21, 4) 31 8 37 130 (21, 5) 31 8 37 136 (27, 6) 32 8 39 146 (33, 7) 34 4 41 238 (39, 8) 51 8 61 265 (42, 7) 56 4 66 286 (45, 6) 61 8 69 341 (48, 9) 68 4 80 344 (75, 13) 68 8 80 496 (75, 11) 94 10 107 526 (87, 13) 99 4 114 904 (93, 14) 154 8 177 916 (93, 13) 156 6 180 1114 (117, 16) 186 4 211 1691 (120, 17) 263 4 297 1736 (135, 16) 270 16 304 1751 (138, 18) 272 4 306 1775 (138, 19) 274 6 309 1781 (168, 21) 275 4 310 2476 (183, 19) 366 6 412 3097 (210, 23) 442 4 495 3551 (228, 29) 497 4 557 5131 (300, 32) 685 4 763 8504 (333, 41) 1060 8 1183 10342 (369, 37) 1269 4 1396 18526 (393, 32) 2122 8 2327 22564 (453, 46) 2521 6 2768 24776 (525, 49) 2740 16 3005 30728 (525, 54) 3315 16 3642 40072 (621, 52) 4209 8 4611 68707 (720, 63) 6828 4 7440 125903 (810, 69) 11811 4 12818 174913 (846, 61) 15909 4 17232 181267 (1086, 92) 16434 4 17796 371428 (1281, 94) 31629 6 34083 827576 (1305, 94) 65990 32 70816 936118 (1515, 106) 73910 4 79252 1054141 (1590, 111) 82413 8 88361 1159864 (1617, 119) 90020 8 96464 1353559 (1722, 119) 103801 4 111156 2591107 (1794, 120) 189274 4 202041
~/github/playmath/stage12-Goldbach Conjecture$ sage verify.sage

ImprovedGoldbachConjecture.java: a Java GUI to search gold(n) in range(n,n+256) by using BigInteger.isProbablePrime(64)

Two simple and clear proof to Goldbach's Conjecture by using Dispatch-Distinct-Prime-Factors method

Today(2019-09-01) morning, I discovered this beautiful inequality below, which shows Goldbach's Conjecture holds true for any integer n>2.

Goldbach Conjecture Inequality 1: gold(n) < prime_pi(n)+sigma(n,0)
gold(n): the min non-negative integer makes that both n-g and n+g are primes
prime_pi(n): the count of primes in 1..n
sigma(n,0): the count of n.divisors()

gold(n) < prime_pi(n), while n>344
gold(n) < prime_pi(n)*4395/3449751 ≈ prime_pi(n)*0.0013, while n>57989356

2019-09-02 dawn, I found:
Goldbach Conjecture Inequality 2: gold(n) < prime_pi(prime_pi(n)+n)

These two inequalities are so straightforward, which directly show you the proving process. Let's prove Inequality 2 firstly, start from

Prime Gap Inequality: p[i+1]-p[i]<=i , the i-th prime gap is less than or equal to i, i=1,2,3,... , here p[i]=nth_prime(i).

Prove: Because we can dispatch distinct prime factors for range(p[i],p[i+1]), the items of the range is [p[i],p[i]+1,p[i+2], ..., p[i+1]-1]
Pigeonhole Principle shows p[i+1]-p[i]<=i, in other word, next_prime(n)-n <= prime_pi(n)
so, p[i]<=i-1 + i-2+...+1+p[1] = 2+i*(i-1)/2

for example:

i p[i] 
9 23 [23, 24, 25, 26, 27, 28]
    [23,  2,  5,  13, 3,  7]

Now, suppose n>6n>6, and nn is composite, factor(n)=p1α1p2α2...prαrfactor(n) = p_1^{{\alpha _1}}p_2^{{\alpha _2}}...p_r^{{\alpha _r}} , sigma(n,0)=(α1+1)(α2+1)...(αr+1)sigma(n,0)=({\alpha _1}+1)*({\alpha _2}+1)...*({\alpha _r}+1)
the number of primes less than nn and coprime with nn is jj, suppose they are [q1,q2,...,qj][q_1,q_2,...,q_j]
then we have prime_pi(n) = r+j ,

consider [(n1,n+1),(n2,n+2),...,(nx,n+x)][(n-1,n+1), (n-2,n+2),...,(n-x,n+x)] , for x=1,2,3,...g, until we get a prime pair (n+g,n-g)
Now, we must can dispatch distinct prime factors for each item. Put it another way, to dispatch distinct prime factors for (n-x)*(n+x) . Prime Gap Inequality ensures these prime be not great than prime_pi(n)+n . Pigeonhole Principle guarantees len(s)<=prime_pi(prime_pi(n)+n), so

gold(n) < prime_pi(prime_pi(n)+n)

and, 2n= (n-g) + (n+g), Goldbach Conjecture is proved!□

In [7]:
@interact def prove2_goldbach_conjecture(n=input_box(default=344)): print('factor(n)=',factor(n)) p,q=n,n x=0 s,factor_list=[],[] while not (is_prime(p) and is_prime(q)): x+=1 p-=1 #p=n-x q+=1 #q=n+x s.append((p,q)) factor_list.append((factor(p),factor(q))) print(s) print(factor_list) print(n,p,q)

Now, I am trying to prove Inequality 1: gold(n) < prime_pi(n)+sigma(n,0)

step 1. construct a list sig_list,

    p,q=n,n
    x=0
    sig_list=[]
    prev=n
    while not is_prime(p):
        x+=1
        q+=1 #q=n+x
        if is_prime(q):
            p=n-x
            if is_prime(p): 
                sig_list.append(p)
            else: 
                prev=previous_prime(prev)
                sig_list.append(prev)
        else:
            sig_list.append(q)

step 2. to drop sigma(n,0) items in sig_list, let target_list is the rest list. Which items to pick out? For every divisor which formed of pxαx...pyαyp_x^{{\alpha _x}}...p_y^{{\alpha _y}},choose one item which formed of kpxαx...pyαyk *p_x^{{\alpha _x}}...p_y^{{\alpha _y}} to drop, and keep k contains as more different prime factors as possible. This means always do not drop n-x(which has been marked as previous_prime(n,?) in sig_list) but drop n+x which contains most different prime factors.

step 3. Now, we must can dispatch distinct prime factors for each item of target_list, Pigeonhole Principle guarantees len(target_list)<=prime_pi(n). so we have,

   `gold(n) < prime_pi(n)+sigma(n,0)`  

Goldbach Conjecture is proved again!□

for example:

n=22
('factor(n)=', 2 * 11, 'sigma(n,0)=', 4)
('sig_list:', [19, 24, 25, 26, 27, 28, 17, 30, 13])
('target_list:', [(19, 2), (17, 2), (13, 2), (5^2, 3), (2 * 13, 4)])
assert tuple[0] of target_list has distinct primes!
(22, 13, 31)


n=46=2*23, sigma(46,0)=4
('factor(n)=', 2 * 23)
('sig_list:', [43, 48, 49, 50, 51, 52, 41, 54, 55, 56, 57, 58, 37, 60, 31])
('target_list:', [(43, 2), (41, 2), (37, 2), (31, 2), (7^2, 3), (3 * 17, 4), (5 * 11, 4), (3 * 19, 4), (2 * 29, 4), (2 * 5^2, 6), (2^2 * 13, 6)])
assert tuple[0] of target_list has distinct primes!
(46, 31, 61)

n=28
('factor(n)=', 2^2 * 7, 'sigma(n,0)=', 6)
('sig_list:', [23, 30, 19, 32, 33, 34, 35, 36, 19])
('target_list:', [(23, 2), (19, 2), (19, 2)])
assert tuple[0] of target_list has distinct primes!
(28, 19, 37)
"""here 19 occurs twice, since 19 is just `n-g`,the last item of sig_list, so it doesn't matter!)"""
In [12]:
@interact def prove1_goldbach_conjecture(n=input_box(default=46)): print('factor(n)=',factor(n),'sigma(n,0)=',sigma(n,0)) p,q=n,n x=0 sig_list=[] prev=n while not is_prime(p): x+=1 q+=1 #q=n+x if is_prime(q): p=n-x # p=2*n-q if is_prime(p): sig_list.append(p) break else: prev=previous_prime(prev) sig_list.append(prev) else: sig_list.append(q) print('sig_list:',sig_list) target_list=[(factor(item),sigma(item,0)) for item in sig_list] target_list=sorted(target_list,key=lambda x: x[1],) target_list=target_list[:-sigma(n,0)] print('target_list:',target_list) print('assert tuple[0] of target_list has distinct primes!') print(n,p,q)

Goldbach Triangle

In [8]:
p=lambda i:nth_prime(i) i=9 range(p(i),p(i+1))
range(23, 29)
In [13]:
n=344 prime_pi(n+prime_pi(n))
80

Goldbach Triangle: GT[i-2,j-2]:= (nth_prime(i)+nth_prime(j))//2 , i>=j>=2

In [11]:
n=37 GT=[] for i in range(2,n): row=[(nth_prime(i)+nth_prime(j))//2 for j in range(2,i+1)] GT.append(row) print(row)
[3] [4, 5] [5, 6, 7] [7, 8, 9, 11] [8, 9, 10, 12, 13] [10, 11, 12, 14, 15, 17] [11, 12, 13, 15, 16, 18, 19] [13, 14, 15, 17, 18, 20, 21, 23] [16, 17, 18, 20, 21, 23, 24, 26, 29] [17, 18, 19, 21, 22, 24, 25, 27, 30, 31] [20, 21, 22, 24, 25, 27, 28, 30, 33, 34, 37] [22, 23, 24, 26, 27, 29, 30, 32, 35, 36, 39, 41] [23, 24, 25, 27, 28, 30, 31, 33, 36, 37, 40, 42, 43] [25, 26, 27, 29, 30, 32, 33, 35, 38, 39, 42, 44, 45, 47] [28, 29, 30, 32, 33, 35, 36, 38, 41, 42, 45, 47, 48, 50, 53] [31, 32, 33, 35, 36, 38, 39, 41, 44, 45, 48, 50, 51, 53, 56, 59] [32, 33, 34, 36, 37, 39, 40, 42, 45, 46, 49, 51, 52, 54, 57, 60, 61] [35, 36, 37, 39, 40, 42, 43, 45, 48, 49, 52, 54, 55, 57, 60, 63, 64, 67] [37, 38, 39, 41, 42, 44, 45, 47, 50, 51, 54, 56, 57, 59, 62, 65, 66, 69, 71] [38, 39, 40, 42, 43, 45, 46, 48, 51, 52, 55, 57, 58, 60, 63, 66, 67, 70, 72, 73] [41, 42, 43, 45, 46, 48, 49, 51, 54, 55, 58, 60, 61, 63, 66, 69, 70, 73, 75, 76, 79] [43, 44, 45, 47, 48, 50, 51, 53, 56, 57, 60, 62, 63, 65, 68, 71, 72, 75, 77, 78, 81, 83] [46, 47, 48, 50, 51, 53, 54, 56, 59, 60, 63, 65, 66, 68, 71, 74, 75, 78, 80, 81, 84, 86, 89] [50, 51, 52, 54, 55, 57, 58, 60, 63, 64, 67, 69, 70, 72, 75, 78, 79, 82, 84, 85, 88, 90, 93, 97] [52, 53, 54, 56, 57, 59, 60, 62, 65, 66, 69, 71, 72, 74, 77, 80, 81, 84, 86, 87, 90, 92, 95, 99, 101] [53, 54, 55, 57, 58, 60, 61, 63, 66, 67, 70, 72, 73, 75, 78, 81, 82, 85, 87, 88, 91, 93, 96, 100, 102, 103] [55, 56, 57, 59, 60, 62, 63, 65, 68, 69, 72, 74, 75, 77, 80, 83, 84, 87, 89, 90, 93, 95, 98, 102, 104, 105, 107] [56, 57, 58, 60, 61, 63, 64, 66, 69, 70, 73, 75, 76, 78, 81, 84, 85, 88, 90, 91, 94, 96, 99, 103, 105, 106, 108, 109] [58, 59, 60, 62, 63, 65, 66, 68, 71, 72, 75, 77, 78, 80, 83, 86, 87, 90, 92, 93, 96, 98, 101, 105, 107, 108, 110, 111, 113] [65, 66, 67, 69, 70, 72, 73, 75, 78, 79, 82, 84, 85, 87, 90, 93, 94, 97, 99, 100, 103, 105, 108, 112, 114, 115, 117, 118, 120, 127] [67, 68, 69, 71, 72, 74, 75, 77, 80, 81, 84, 86, 87, 89, 92, 95, 96, 99, 101, 102, 105, 107, 110, 114, 116, 117, 119, 120, 122, 129, 131] [70, 71, 72, 74, 75, 77, 78, 80, 83, 84, 87, 89, 90, 92, 95, 98, 99, 102, 104, 105, 108, 110, 113, 117, 119, 120, 122, 123, 125, 132, 134, 137] [71, 72, 73, 75, 76, 78, 79, 81, 84, 85, 88, 90, 91, 93, 96, 99, 100, 103, 105, 106, 109, 111, 114, 118, 120, 121, 123, 124, 126, 133, 135, 138, 139] [76, 77, 78, 80, 81, 83, 84, 86, 89, 90, 93, 95, 96, 98, 101, 104, 105, 108, 110, 111, 114, 116, 119, 123, 125, 126, 128, 129, 131, 138, 140, 143, 144, 149] [77, 78, 79, 81, 82, 84, 85, 87, 90, 91, 94, 96, 97, 99, 102, 105, 106, 109, 111, 112, 115, 117, 120, 124, 126, 127, 129, 130, 132, 139, 141, 144, 145, 150, 151]
By observing Goldbach Triangle, we can conjecture that any even number n>=14 can be written to the sum of two primes in at least two forms. Since any integer n>=7 occurs twice or more in Complete Goldbach Triangle. If there are some sequence make that any natural number n>=3 can be written as the median of two items, the primes sequence seems to be the most ideal candidate. Because nth_prime(n) just can be defined as p[n]={min(x) satisfy x>p[n-1] && x%p[j]!=0 for j=1,2,...,n-1 }.