1. What is the Goldbach conjecture
In his letter to Euler in 1742, Goldbach proposed the following conjecture: Any integer greater than 2 can be written as the sum of three prime numbers. Since the mathematical community now does not use the convention that "1 is also a prime number", the modern statement of the original conjecture is that any integer greater than 5 can be written as the sum of three prime numbers. In his reply, Euler also proposed another equivalent version, that is, any even number greater than 2 can be written as the sum of two prime numbers. The common conjecture statement today is Euler's version. The proposition "any sufficiently large even number can be represented as the sum of a number whose number does not exceed a and another element has no more than b "remembered as "a+b". In 1966, Chen Jingrun proved that "1+2" is true, that is, "any sufficiently large even number can be represented as the sum of two prime numbers, or the sum of one prime number and one half prime number."
Goldbach's Conjecture Atlas:
It looks messy, almost the same as when I take notes. .
The illustrations compiled from the manuscript:
2. Programming verification: Even numbers between 6 and 100 will be the sum of two prime numbers.
package com.test.common;public class TestGede {/*Judge whether prime number is prime*/static int prime(int i) {if(i==2) return 1; else {for (int k=2;k<i;k++) {if(i%k==0)return 0;}return 1;}}/** * @param args */public static void main(String[] args) {// TODO Auto-generated method stub for (int i=6;i<=100;i++) {for (int j=2;j<i-1;j++) {/*Split whether both numbers are prime numbers, if both are prime numbers, output, otherwise continue to traverse */if(prime(j)==1 && prime(ij)==1) System.out.println(i+"="+j+"+"+(ij));continue;}}}}3. Output result
Summarize
The above is all about the implementation of Java programming verification of the Goldbach conjecture, and I hope it will be helpful to everyone. Interested friends can continue to refer to other related topics on this site. If there are any shortcomings, please leave a message to point it out. Thank you friends for your support for this site!