Home > Software engineering >  1234567 seven of the number of how many prime Numbers, are respectively? Written in C,, be urgent!!!
1234567 seven of the number of how many prime Numbers, are respectively? Written in C,, be urgent!!!

Time:10-12

Expert help, such as topic,,,,

CodePudding user response:

Pray god to help have a look at ah,,,,,,,,,,,,,,,,,,,,,,

CodePudding user response:

Problem is not complete, these Numbers can reuse? If so, what's the number limit is how much?

To solve this problem, is to discriminate whether the Numbers for each kind of permutation and combination and prime,

Arrangement is very simple, such as (assuming you are not allowed to reuse) :

1:1, 2, 3, 4, 5, 6, 7
2:12, 13, 14, 15, 16, 17, 21, 23, 24, 25, 26...

Prime Numbers of there are two ways:
1 look-up table method, there's no need to speak;
2 calculate test (element determination algorithm) :
The simplest method is to less than the square root of all prime Numbers again, cannot be divided exactly by except (1), is a prime,
Faster method is generally called probabilistic judgment method, as fermat's theorem, Montgomery algorithm, miller - rabin algorithm, Lucas algorithm, etc., are all involved in number theory knowledge, is more complex,