Fortune Telling Collection - Comprehensive fortune-telling - Prime numbers and composite numbers are always confused. Somebody help me sum them up.
Prime numbers and composite numbers are always confused. Somebody help me sum them up.
1. Only 1 and its own natural number are called prime numbers. In other words, a prime number has only 1 and its own two divisors. 2. A prime number is an integer, and it cannot be expressed as the product of any other two integers except itself and 1. For example, 15 = 3× 5, then 15 is not a prime number;
For another example, 12 = 6× 2 = 4× 3, then 12 is not a prime number. On the other hand, 13 cannot be expressed as the product of any other two integers except 13x1,so13 is a prime number.
[Edit this paragraph] The concept of prime number
If a number has only two factors: 1 and itself, it is called a prime number. For example, (within 10) 2, 3, 5 and 7 are prime numbers, and 4, 6, 8 and 9 are not. The latter is called a composite number or a composite number. Specifically, 1 is neither a prime number nor a composite number. Why is 1 not a prime number? Because if 1 is counted as a prime number, you can add several 1 when you decompose the prime factor. For example, 30, the factorization prime factor is 2*3*5, because factorization prime factor is to write a number as a continuous product of prime numbers. If 1 is counted as a prime number, then this formula can add several 1 at will, but it cannot decompose the prime factor. From this point of view, integers can be divided into two types, one is called prime number and the other is called composite number. (1 is neither a prime number nor a composite number) The famous Gauss "unique decomposition theorem" says that any integer. It can be written as the product of a series of prime numbers. All prime numbers are odd except that 2 is even. 2000 years ago, Euclid proved that there are infinitely many prime numbers. Since there is infinity, is there a general formula? For two thousand years, an important task of number theory is to find a universal formula of prime numbers and a universal formula of twin prime numbers that can represent all prime numbers. To this end, mankind has spent great efforts. Hilbert thinks that if there is a universal formula for prime numbers, then these Goldbach conjecture and twin prime number conjecture can be solved.
[Edit this paragraph] The Mystery of Prime Numbers
The distribution of prime numbers is irregular and often confusing. For example, 10 1, 40 1, 60 1, 70 1 are all prime numbers, but the upper and lower 30 1(7*43) and 901(/.
Someone has done this calculation:12+1+41= 43, 2 2+2+4 1 = 47, 3 2+3+4 1 = 53 ...........................................................................'s formula holds up until n=39. But when n=40, the formula is invalid, because 40 2+40+41=1681= 41× 41.
Speaking of prime numbers, Goldbach's conjecture is essential, that is, the famous "1+ 1". Goldbach conjecture: (Goldbach conjecture)
All even numbers not less than 6 can be expressed as the sum of two odd prime numbers, and every odd number not less than 9 can be expressed as the sum of three odd prime numbers.
This question was put forward by the German mathematician C Goldbach (1690- 1764) in a letter to the great mathematician Euler on June 7th, 742, so it is called Goldbach conjecture. On June 30th of the same year, Euler replied that this conjecture may be true, but he could not prove it. Since then, this mathematical problem has attracted the attention of almost all mathematicians. Goldbach conjecture has therefore become an unattainable "pearl" in the crown of mathematics. "In contemporary languages, Goldbach conjecture has two contents, the first part is called odd conjecture, and the second part is called even conjecture. Odd number conjecture points out that any odd number greater than or equal to 7 is the sum of three prime numbers. Even conjecture means that even numbers greater than or equal to 4 must be the sum of two prime numbers. " (Quoted from Goldbach conjecture and Pan Chengdong)
Goldbach conjecture seems simple, but it is not easy to prove, which has become a famous problem in mathematics. In 18 and 19 centuries, all number theory experts did not make substantial progress in proving this conjecture until the 20th century. It is directly proved that Goldbach's conjecture is not valid, and people adopt "circuitous tactics", that is, first consider expressing even numbers as the sum of two numbers, and each number is the product of several prime numbers, which is called "almost prime numbers", that is, there are few pixels. If the proposition that "every big even number can be expressed as the sum of a number whose prime factor is not greater than A and another number whose prime factor is not greater than B" is recorded as "A+B", then the Coriolis conjecture is to prove that "1+ 1" holds, and a sufficiently large even number Chen Jingrun refers to the 5000000 power of 10.
1900, Hilbert, the greatest mathematician in the 20th century, listed Goldbach conjecture as one of the 23 mathematical problems at the International Mathematical Congress. Since then, mathematicians in the 20th century have "joined hands" to attack the world's "Goldbach conjecture" fortress, and finally achieved brilliant results.
In the 1920s, people began to approach it. 1920, the Norwegian mathematician Bujue proved by an ancient screening method that every even number greater than 6 can be expressed as (9+9). This method of narrowing the encirclement is very effective, so scientists gradually reduce the number of prime factors of each number from (99) until each number is a prime number, thus proving Goldbach's conjecture.
1920, Bren of Norway proved "9+9".
1924, Rademacher proved "7+7".
1932, Esterman of England proved "6+6".
1937, Ricei of Italy proved "5+7", "4+9", "3+ 15" and "2+366" successively.
1938, Byxwrao of the Soviet Union proved "5+5".
1940, Byxwrao of the Soviet Union proved "4+4".
1948, Hungary's benevolence and righteousness proved "1+c", where c is the number of nature.
1956, Wang Yuan of China proved "3+4".
1957, China and Wang Yuan successively proved "3+3" and "2+3".
1962, Pan Chengdong of China and Barba of the Soviet Union proved "1+5", and Wang Yuan of China proved "1+4".
1965, Byxwrao and vinogradov Jr of the Soviet Union and Bombieri of Italy proved "1+3".
1966, China and Chen Jingrun proved "1+2" [in popular terms, it means even number = prime number+prime number * or even number = prime number+prime number (Note: the prime numbers that make up even numbers cannot be even numbers, but only odd numbers. Because there is only one even prime number in the prime number, that is 2. )]。
The "s+t" problem refers to the sum of the products of S prime numbers and T prime numbers.
The main methods used by mathematicians in the 20th century to study Goldbach's conjecture are screening method, circle method, density method, triangle method and so on. The way to solve this conjecture, like "narrowing the encirclement", is gradually approaching the final result. Paul and Hoeffmann wrote on page 35 of Revenge of Archimedes: Almost prime number and large enough are ambiguous concepts.
It is found that (1+2) is much more difficult than (1+ 1) if almost prime numbers are removed. (1+3) is much more difficult than (1+2).
(1+ 1) is an even number (i.e. n >;) greater than the power of 1 of the first prime number "2" plus 1; 2+ 1) is the sum of a prime number and a prime number.
(1+2) is an even number greater than the second prime number "3", and 1 (that is, n > 3x3+ 1 = 10) is the sum of the products of one prime number and two prime numbers. For example, 12=3×3+3.
(1+3) is an even number (that is, n > 5x5x5+ 1 = 126), which is greater than the cubic addition of the third prime number "5" 1. For example, 128 = 5x5+3 = 5x5x3+53. Even numbers less than 128 cannot be expressed as (1+3), such as 4, 6, 8, 10, 12, 14,16,65438+.
(1+4) is an even number (that is, n > 7x7x7+1 = 2402), which is greater than the fourth prime number "7" plus1. For example, 2404=240 1+3. There are hundreds of even numbers less than 2044 that cannot be represented (1+4).
This is because the smaller the number of natural numbers, the more prime numbers, the less the composite number. For example, 100 has 25 prime numbers, 18 odd numbers have two prime factors, 5 composite numbers have three prime factors (27, 45, 63, 75, 99), and only 1 composite numbers have four prime factors (8 1). In fact, Goldbach conjecture is only the most difficult problem of this kind. Many problems are waiting for people to overcome.
Thanks to Chen Jingrun's contribution, mankind is only one step away from the final result of Goldbach's conjecture "1+ 1". But in order to achieve this last step, it may take a long exploration process. Many mathematicians believe that to prove "1+ 1", new mathematical methods must be created, and the previous methods are probably impossible.
Editor: Guo Wei
[Edit this paragraph] "Prime number"-Several English explanations of prime numbers
1. In mathematics, a prime number (or prime number) is a natural number greater than one, and its only positive divisor is one and itself. In short, a prime number is a natural number with exactly two natural number factors. Natural numbers that are greater than one and not prime numbers are called composite numbers. The numbers 0 and 1 are neither prime nor composite. The nature of prime numbers is called prime. Prime numbers are very important in number theory. [From Wikipedia]
2. An integer that is not divisible by any integer except itself and one and has no remainder. [From American Traditional Dictionary]
3. Any integer except 0 or 1 cannot be divisible by any other integer except 1 and the integer itself. [The collegiate bench from Webster's dictionary? Dictionary]
4. A number that can only be divisible by itself and the number one. For example, three and seven are prime numbers. [Excerpted from Longman Dictionary of Contemporary English]
[Edit this paragraph] Properties of Prime Numbers
Fermat, known as "/kloc-the greatest French mathematician in the 7th century", also studied the properties of prime numbers. He found that if Fn = 2 (2 n)+ 1, then when n is equal to 0, 1, 2, 3 and 4 respectively, Fn gives 3, 5, 17, 257 and 65537 respectively, which are all prime numbers. Because F5 is too big (F5 has a problem! Sixty-seven years after Fermat's death, Euler, a 25-year-old Swiss mathematician, proved that F5 = 4294967297 = 641* 6700417 is not a prime number, but a composite number.
More interestingly, mathematicians have never found out which Fn values are prime numbers, and they are all composite numbers. At present, due to the large square, there are few proofs. Now mathematicians get the maximum value of Fn: n= 1495. This is a super astronomical figure, with as many as 10 10584 digits. Of course, although it is big, it is not a prime number. Prime number and Fermat played a big joke!
Another kind is called "almost prime number", which means there are many pixels. The famous mathematician Chen Jingrun used this concept. The "2" of his "1+2" means "almost prime number", which is actually a composite number. Let's not confuse. Strictly speaking, "almost prime number" is not a scientific concept, because the characteristic of scientific concept is (1) accuracy; (2) stability; (3) it can be checked; (4) systematic; (5) specificity. For example, many mathematicians use "big enough", which is also a vague concept, because Chen Jingrun defined it as "10 to the power of 500,000", which means adding 500,000 "0s" after 1. This is an unverifiable figure.
[Edit this paragraph] Assumption of Prime Numbers
In the17th century, there was a French mathematician named Mei Sen. He once made a guess: 2 p- 1 algebraic expression, when p is a prime number, 2 p- 1 is a prime number. He checked that when p=2, 3, 5, 7, 1 1, 13, 17, 19, the values of the algebraic expressions obtained are all prime numbers. Later, Euler proved that Mp is a prime number when p=3 1 and when p = 2, 3, 5 and 7, but M 1 1 = 2047 = 23× 89 is not a prime number.
Now there are three Mason numbers left, p=67,127,257, which have not been verified for a long time because they are too big. 250 years after Mei Sen's death, American mathematician Kohler proved that 267-1=193707721* 761838257287 is a composite number. This is the ninth Mei Sen number. In the 20th century, people successively proved that 10 Mason number is a prime number and 1 1 Mason number is a composite number. The disordered arrangement of prime numbers also makes it difficult for people to find the law of prime numbers.
[Edit this paragraph] Prime numbers on the Prime Table
The largest Mason number found by mathematicians now is a number with 12978 189 digits: 243112609-1. Although a large number of prime numbers can be found in mathematics, the law of prime numbers still cannot be followed.
[Edit this paragraph] Method for finding large prime numbers
It is found that prime numbers are all odd numbers except 2, and odd numbers are all prime numbers except odd * odd (or "odd"). Then use the computer to find out all odd numbers * odd numbers (or add "* odd numbers") (such as 9, 15, 2 1, 25, 27, 33, 35, 39 ...), and then find out those numbers that are not mentioned above in the odd numbers, and those numbers are prime numbers.
Several super prime numbers found by people are all missing. We can find those missing numbers by this method, but it will take a long time!
This is helpful for "twin prime numbers"!
The above algorithm is troublesome, and the efficiency of finding large prime numbers is very low. This big prime number can be found by probability algorithm.
To find a prime number, please use axiom and prime number calculation. This method does not need to write all odd numbers, and the calculated prime numbers cannot be omitted. For the deletion of complex numbers, not all odd numbers are involved, and deletion is accurate. After deleting odd numbers, the rest are prime numbers. For example, to delete a number that is a multiple of odd prime number 3, only one number in the whole natural number needs to be deleted; Delete the number of multiples of prime number 5, and only 2 numbers need to be deleted from the whole natural number; Delete the number of multiples of prime number 7, and only 8 numbers need to be deleted from the whole natural number; By analogy, if a teacher can program with a computer, it will be of great help to calculate prime numbers.
[Edit this paragraph] The number of prime numbers
There is an approximate formula: the number of prime numbers in x is approximately equal to x/ln(x)
Ln stands for natural logarithm.
/kloc-in the 9th century, people proved that "there must be a prime number between x and 2x, and there are infinite prime numbers in (x ∈ R.)" and "kx+b, (x, k, b ∈ R.)", but another guess is that x 2 and (x+/kloc-.
No exact prime formula was given.
* * */4 prime numbers within kloc-0/0.
25 prime numbers within 100 * *.
Prime numbers within 1000 *** 168.
Prime numbers within 10000 * * 1229.
9592 prime numbers within * *100000.
1000000 * * 78498 prime number.
1000000 * * 664579 within the prime number.
Prime numbers within 1000000 * * 576 1455.
......
The total number is infinite.
[Edit this paragraph] Method for finding prime numbers
The ancient screening method can quickly find all prime numbers (prime numbers) within 100000000.
The screening method is a method to find all the prime numbers that do not exceed the natural number n (n > 1). It is said that it was invented by Eratosthenes in ancient Greece (about 274 ~ 194 BC), also known as Eratosthenes sieve.
The specific method is: first, arrange n natural numbers in order. 1 is not a prime number or a composite number and should be crossed out. The second number, 2, is a prime number. After 2, all numbers divisible by 2 are crossed out. The first number not crossed out after 2 is 3, leave 3, and then cross out all the numbers divisible by 3 after 3. The first number not crossed out after 3 is 5, leave 5, and then cross out all the numbers divisible by 5 after 5. If you keep doing this, you will filter out all the composite numbers that don't exceed N, leaving all the prime numbers that don't exceed N, because the Greeks wrote numbers on a wax board, and every time they crossed out a number, they wrote points on it. After the work of finding prime numbers is completed, many points are like a sieve, so Eratosthenes's method is called "Eratosthenes sieve", or "sieve method" for short. Another explanation is that the numbers at that time were written on papyrus, and every time a number was crossed out, a number was dug up. After the work of finding prime numbers is finished, these holes are like sieves. )
procedure
# include & ltstdio.h & gt
# include & lttime.h & gt
# Define the maximum value 100000 10
int n,p[MAX],tot = 0;
Double s, t;
FILE * fp
Invalid prime number ()
{ int i,j,t = sqrt(n)+ 1;
for(I = 2; I & ltt;; i++)
If (p[i])
{ fprintf(fp," %d\n ",I);
tot++;
j = I+I;
while(j & lt; n)
{ p[j]= 0;
j+= I;
}
}
for(I = t+ 1; I & ltn;; i++)
If (p[i])
{ tot++;
fprintf(fp," %d\n ",I);
}
}
Master ()
{ int I;
fp=fopen("prime.txt "," w ");
scanf("%d ",& ampn);
s = clock();
for(I = 0; I & ltn;; i++)
p[I]= 1;
prime();
t = clock();
fprintf(fp," Num = %d\nTime = %.0lf ms\n ",tot,t-s);
fclose(FP);
}
Test result of this machine: 1000000 takes time 1 156 milliseconds (1. 156 seconds).
100000000 takes 80 seconds (slow, mainly due to too little memory and repeated hard disk reading).
//Find the prime number between 1 and 10000 with JAVA program.
Public class Prime_Number{
Public static void main(String []args){
System. Out. println(" 1 to 10000, the prime number is ");
//Because 1 is neither a prime number nor a composite number, it is judged from 2.
for(int I = 2; I< 10000; i++){
Boolean f = true;
for(int j = 2; J< me; j++){
if(i%j == 0){
F = false;
Break;
}
}
If (! f){
Continue;
}
system . out . print(I+" \ t ");
}
}
}
[Edit this paragraph] Method for judging prime numbers
1 naive screening method is direct trial and error.
If a is a factor of n, then n/a is also a factor of n, so if n has a real factor greater than 1, there must be a factor not greater than 1/2 to the nth power.
Furthermore, if n is a composite number, it must have a prime factor not greater than n to the power of 1/2. If you want to check whether a number within m is a prime number, you need to establish a prime number table within the power of 1/2 in advance.
4 Miller-Rabin algorithm
5 probability algorithm
6 unconditional prime number test (including APR algorithm Jacobian and test, etc. )
......
Efficiency comparison:
The screening method of Eraosthenes is more common in efficiency.
What is more efficient is that
Jacobian sum test
Even better, there is
Miller-Rabin algorithm (Monte Carlo series algorithm)
However, this is a probabilistic algorithm, which relies on ERH (Extended Riemann Hypothesis).
The prime number determination algorithms used now are as follows
Unconditional prime test (based on algebraic number theory)
In recent 15 years, elliptic curve algorithm appeared.
Random curve, Abel variation test
Interpretation and proof of judging prime numbers in programming languages
That is, if you divide n by all integers between 2 and the root number n, you can prove whether n is a prime number.
Proof: Hypothesis
ordinary
There is no factor from 2 to the root number n.
He has a factor m greater than the root number n.
Obviously: N/m = n (integer), because m >;; Root number n, n
This shows that n has its factor from 2 to the root number n.
Contrary to hypothesis
One way to find a prime number is to use the method of "If it is, leave it, if not, remove it" from 2 (until you don't want to go any further, for example, until 10000).
The first number is 2, which is a prime number, so we have to keep it, and then continue to count down, and delete every other number, so that we can remove all numbers that are divisible by 2 and are not prime numbers. stay
In the lowest number, 3 ranks after 2, and 2 is the second prime number, so you should leave it and count backwards from it, and delete one from every two numbers, so that all numbers divisible by 3 can be complete.
Remove them all. The next undeleted number is 5, and then every four numbers will be deleted, and all numbers divisible by 5 will be removed. The next number is 7, and one will be deleted every 6 numbers; The next number is 1 1.
Delete one every 10 in the future; The next one is 13, and one will be deleted every 12. ..... so do it according to law.
You may think that if you delete it like this, as more and more people delete it, it will eventually happen; After a certain number, all the numbers will be deleted. After a certain largest prime number, it will never
There will be prime numbers. But in fact, such a situation will not happen. No matter what number you take, one million or one million, there will always be a prime number bigger than it.
In fact, as early as 300 BC, the Greek mathematician Euclid proved that no matter how big a number you take, there must be a prime number bigger than it. Suppose you take out the first six prime numbers and multiply them.
Add up: 2× 3× 5× 7× 1 ×13 = 30030, and add1to get 3003 1. This number cannot be divisible by 2,3,5,7, 1 1, 13, because the result of each division will be 1. If 3003 1 is not divisible by any number except itself, it is a prime number. If it can be divisible by other numbers, then the numbers decomposed by 3003 1 must all be greater than 13. Actually, 3003 1 = 59× 509.
This can be done for the first 100,1100,000 or any number of prime numbers. If 1 is added after calculating their products, the number obtained is either a prime number or the product of several prime numbers greater than the listed prime numbers. No matter how big the number is, there is always a prime number bigger than it, so the number of prime numbers is infinite.
With the increase of numbers, we will repeatedly encounter two adjacent odd pairs that are prime numbers, such as 5, 7; 1 1, 13; 17, 19; 29,3 1; 4 1,43; Wait a minute. As far as mathematicians are concerned, they can always find such a pair of prime numbers. Is such a pair of prime numbers infinite?
Where is it? Nobody knows. Mathematicians thought it was infinite, but they never proved it. This is why mathematicians are interested in prime numbers. Prime numbers provide mathematicians with some seemingly simple facts.
However, it is very difficult to solve the problem, and they are not capable of meeting this challenge.
Prime number program
For i= 1 to 100.
For j=2 to I
If j=i
? I
endif
If mod(i, j)=0.
export
endif
end
end
A composite number is an integer divisible by other integers except 1 and itself.
Even numbers except 0 and 2 are composite numbers.
A composite number, also called a composite number, is a positive integer that satisfies one of the following (equivalent) conditions:
1. is the product of two integers greater than 1;
2. There is a factor); greater than 1 and less than itself;
3. There are at least three factors (factors);
4. It is neither 1 nor a prime number (prime number);
5. Non-prime numbers with at least one prime factor.
[Edit this paragraph] The conclusion of special composite numbers
A composite number has an odd number of factors (factors) if and only if it is a complete square number.
1. Only 1 and itself, there is no other factor called prime number (also called prime number). (For example: 2 ÷ 1 = 2,2 ÷ 2 =1,so the factor of 2 is only1and itself 2,2 is a prime number).
2. Besides 1 and itself, there are other factors, which are called composite numbers. (For example, 4 ÷1= 4,4 ÷ 2 = 2,4 ÷ 4 =1. Obviously, the factor of 4 is a composite number other than 1 and itself 4. ).
3. 1 is neither a prime number nor a composite number because its factor is only 1.
4. A composite number is a number with more than two factors.
5. Numbers that can be divisible by one or more of 2, 3, 5 and 7 within100 are composite numbers, but 2, 3, 5 and 7 themselves are not included.
6. A number in the form of AB+X must be a composite number (B is a natural number, (a, x)≠ 1.
I'm puzzled: Can the sixth A be 0? If a=0, b=5 and x=2, then ab+x=2. So, isn't 2 a composite number?
4.6.8.9 . 10. 12. 14. 15. 16. 18.20.2 1 .22.24.25.26.27.28.30.32.33.34.35.36.38.39.40.42.44.45.46.48.49.50.5 1.52 .54.55.56.57.58.60.62.63.64.65.66.68.69.70.72.74.75.76.77.78.80.8 / kloc-0/.82.84.85.86.87.88.90.9 1.92.93.94.95.96.98.99. 100
- Previous article:What does fortune telling mean, marry a wife?
- Next article:Do you know how to go and see your own destiny?
- Related articles
- How did Angie's children grow up in the love of their parents?
- Dan character fortune telling
- Pearl in fortune-telling palm _ What does the pearl in fortune-telling palm represent?
- What do you mean by eating delicious food?
- Women dream that they vomit and get sick.
- Is the person born on February 4, 65438 terrible? Is it terrible?
- What are the top time pillars and the top ten windfall pillars?
- There are dark peach blossoms in fortune telling _ Is there a saying that there are dark peach blossoms in fortune telling?
- The fairy's tail is 350 words.
- The rich woman was robbed100000 cash. Which episode is it?