哥德巴赫猜想的故事

Math Day 6:

哥德巴赫猜想 in Python:

因为陈景润的故事, 很多人都特别关注哥德巴赫猜想 Goldbach Conjecture. 普罗大众认为这是世界上最难的数学问题 .
其实哥德巴赫猜想特别容易理解,只是还没有人能给出证明。

哥德巴赫猜想. 每一个大于2的偶数都能表示成两个素数之和.

例子:
4=2+2, 6=3+3, 18=7+11...

背景小故事-平民数学家也有春天:

In 1742, Christian Goldbach(哥德巴赫),一个平民数学家给当时的数学泰斗欧拉(就是最基本的e=2.73) Leonhard Euler(e^iπ+1=0)*写了一封信,说他有个猜想:

Every even number greater than 4 can be
written as the sum of two odd prime numbers.
每个大于4的偶数都可以用两个是奇数的素数之和表示

智者千虑必有一疏,欧拉当时没有很注意这封信,因为他觉得这不是显然的吗。然而,举例不是证明,哥德巴赫猜想到2019还是没有被证明.

in 2013, 张益唐证明了 first finite bound on the least gap between consecutive primes, 这在数学里就更接近证明Twin- Prime conjecture, 如果栾生素数可以证出来,哥德巴赫猜想也许就不远了.

[caption id="attachment_2394" align="alignnone" width="500"]
8699364-aa8cf354c9320558.jpg

aingnamma / Pixabay[/caption]

我读书的时候,不是最聪明的那一拨学生。但是我还是足够聪明到不去想着试一下证明 哥德巴赫猜想. 不过游手好闲也不是我的风格, 所以我觉定用Python来测试一下哥德巴赫猜想.

Goldbach Conjecture Python Trial:

GoldBach Conjecture 

import math
MAX=10000;

primes=[];

def sieveSundaram():
    marked=[False]*(int(MAX/2)+100);
    for i in range(1, int((math.sqrt(MAX)-1)/2)+1):
        for j in range((i*(i+1))<< 1, int(MAX/2)+1, 2*i+1):
            marked[j]=True;

    primes.append(2);

    for i in range(1, int(MAX/2)+1):
        if (marked[i]==False):
            primes.append(2*i+1);        

def findPrimes(n):
    if (n <=2 or n % 2 !=0):
       print("Even Number");
       return;

    i=0;
    while (primes[i] <= n //2):
        diff=n-primes[i];
        if diff in primes:
            print(primes[i], "+", diff, "=", n);
            return;
        i+=1;    

sieveSundaram();
findPrimes(4);
findPrimes(22);

#This code is contributed  by chandan_jnu

Output:

findPrimes(4);
2 + 2 = 4

findPrimes(22);
3 + 19 = 22

findPrimes(5000);
7 + 4993 = 5000

findPrimes(8800);
17 + 8783 = 8800

findPrimes(9998);
31 + 9967 = 9998

Personal Thoughts:

我有一个坏习惯,就是看好多电视节目。 每次只要有和数学相关的真人秀,主持人总会说 "太厉害了,天才,... " 或者 "哥德巴赫猜想能解出来吗?".科学,特别是数学界里从来不缺乏天才,但是媒体总是渲染他们的聪明多于看到他们不为人知的努力。我在水牛城的那些年,只要我去看,星期五晚上十点总有办公室都亮着灯的。而且,数学不只是枯燥的,它还有很多有趣的问题。像 费马大定理 (solved in 1993, Wiles ). 黎曼猜想, Navier-Stroke,
P vs NP problem, 庞卡尼猜想(solved in 2003 by Perelman), 孪生素数猜想....

Happy Practicing!

Reference:

https://web.stanford.edu/class/cs97si/probs/2262.htm

https://en.wikipedia.org/wiki/Yitang_Zhang

https://www.geeksforgeeks.org/program-for-goldbachs-conjecture-two-primes-with-given-sum/

转载于:https://www.jianshu.com/p/3b39024b60ab

猜你喜欢

转载自blog.csdn.net/weixin_34242658/article/details/91073046