Ilya's answer is correct, but not very detailed. In the 18th century, by the way, one was still considered a prime number. For example, such major mathematicians as Euler and Goldbach. Goldbach is the author of one of the seven tasks of the millennium - the Goldbach hypothesis. The original formulation states that any even number can be represented as the sum of two prime numbers. Moreover, initially 1 was taken into account as a prime number, and we see this: 2 = 1 + 1. This smallest example, which satisfies the original formulation of the hypothesis. Later it was corrected, and the wording acquired modern look: "every even number, starting from 4, can be represented as the sum of two prime numbers."

Let's remember the definition. A prime number p is a natural number p that has only 2 different natural divisors: p itself and 1. A corollary from the definition: a prime number p has only one prime divisor - p itself.

Now suppose 1 is a prime number. By definition, a prime number has only one prime divisor - itself. Then it turns out that any prime number greater than 1 is divisible by a prime number that differs from it (by 1). But two distinct prime numbers cannot be divisible by each other, because otherwise they are not prime, but composite numbers, and this contradicts the definition. With this approach, it turns out that there is only 1 prime number - the unit itself. But this is absurd. Therefore, 1 is not a prime number.

1, as well as 0, form another class of numbers - the class of neutral elements with respect to n-nar operations in some subset of the algebraic field. Moreover, with respect to the addition operation, 1 is also a generating element for the ring of integers.

Considering this, it is not difficult to find analogues of prime numbers in other algebraic structures. Suppose we have a multiplicative group formed from powers of 2 starting from 1: 2, 4, 8, 16, ... etc. 2 acts here as a forming element. A prime number in this group is a number that is greater than the smallest element and divisible only by itself and the smallest element. In our group, only 4 have such properties. That's it. There are no more prime numbers in our group.

If 2 were also a prime number in our group, then see the first paragraph - again it would turn out that only 2 is a prime number.

Numbers are different: natural, natural, rational, integer and fractional, positive and negative, complex and prime, odd and even, real, etc. From this article you can learn what prime numbers are.

What numbers are called the English word "simple"?

Very often, schoolchildren do not know how to answer one of the most seemingly simple questions in mathematics, about what a prime number is. They often confuse prime numbers with natural numbers (that is, the numbers that people use when counting objects, while in some sources they start from zero, and in others - from one). But it's completely two different concepts. Prime numbers are natural numbers, that is, integer and positive numbers that are greater than one and that have only 2 natural divisors. In this case, one of these divisors is a given number, and the second is a unit. For example, three is a prime number because it is not evenly divisible by any number other than itself and one.

Composite numbers

The opposite of prime numbers are composite numbers. They are also natural, also greater than one, but have not two, but large quantity dividers. So, for example, the numbers 4, 6, 8, 9, etc. are natural, composite, but not prime numbers. As you can see, these are mostly even numbers, but not all. But the “two” is an even number and the “first number” in a series of prime numbers.

Subsequence

To build a series of prime numbers, it is necessary to make a selection from all natural numbers, taking into account their definition, that is, you need to act by contradiction. It is necessary to consider each of the natural positive numbers on the subject of whether it has more than two divisors. Let's try to build a series (sequence) that consists of prime numbers. The list starts with two, then comes three, since it's only divisible by itself and one. Consider the number four. Does it have divisors other than four and one? Yes, that number is 2. So four is not a prime number. Five is also prime (besides 1 and 5, it is not divisible by any other number), but six is ​​divisible. And in general, if you follow all the even numbers, you will notice that apart from “two”, none of them is prime. From this we conclude that even numbers, except for two, are not prime. Another discovery: all numbers that are divisible by three, except for the triple itself, whether even or odd, are also not prime (6, 9, 12, 15, 18, 21, 24, 27, etc.). The same applies to numbers that are divisible by five and seven. All their set is also not simple. Let's summarize. So, to simple single digits all odd numbers are included, except for one and nine, and of even numbers, only “two”. The tens themselves (10, 20,... 40, etc.) are not prime. Two-digit, three-digit, etc. prime numbers can be defined based on the above principles: if they have no other divisors than themselves and one.

Theories about the properties of prime numbers

There is a science that studies the properties of integers, including prime ones. This is a branch of mathematics, which is called higher. In addition to the properties of integers, she also deals with algebraic, transcendental numbers, as well as functions various origins associated with the arithmetic of these numbers. In these studies, in addition to elementary and algebraic methods, analytical and geometric ones are also used. Specifically, the study of prime numbers deals with "Number Theory".

Prime numbers are the “building blocks” of natural numbers

In arithmetic there is a theorem called the main theorem. According to it, any natural number, except for unity, can be represented as a product, the factors of which are prime numbers, and the order of the factors is unique, which means that the representation method is unique. It is called the decomposition of a natural number into prime factors. There is another name for this process - factorization of numbers. Proceeding from this, prime numbers can be called “building material”, “blocks” for constructing natural numbers.

Search for prime numbers. Simplicity Tests

Many scientists of different times tried to find some principles (systems) for finding a list of prime numbers. Science knows systems called Atkin's sieve, Sundartam's sieve, Eratosthenes' sieve. However, they do not give any significant results, and a simple test is used to find prime numbers. Algorithms were also created by mathematicians. They are called primality tests. For example, there is a test developed by Rabin and Miller. It is used by cryptographers. There is also a Kayala-Agrawala-Saskena test. However, despite its sufficient accuracy, it is very difficult to calculate, which diminishes its practical value.

Does the set of primes have a limit?

The fact that the set of primes is infinity was written in the book "Beginnings" by the ancient Greek scientist Euclid. He said this: “Let's imagine for a moment that prime numbers have a limit. Then let's multiply them with each other, and add one to the product. The number obtained as a result of these simple operations cannot be divisible by any of the series of prime numbers, because the remainder will always be one. And this means that there is some other number that is not yet included in the list of prime numbers. Therefore, our assumption is not true, and this set cannot have a limit. In addition to Euclid's proof, there is a more modern formula given by the eighteenth-century Swiss mathematician Leonhard Euler. According to him, the sum, the reciprocal of the sum of the first n numbers, grows indefinitely with the growth of the number n. And here is the formula of the theorem regarding the distribution of prime numbers: (n) grows like n / ln (n).

What is the largest prime number?

All the same Leonard Euler was able to find the largest prime number for his time. This is 2 31 - 1 = 2147483647. However, by 2013, another most accurate largest in the list of prime numbers was calculated - 2 57885161 - 1. It is called the Mersenne number. It contains about 17 million decimal digits. As you can see, the number found by a scientist from the eighteenth century is several times smaller than this. It should have been so, because Euler did this calculation manually, but our contemporary was probably helped by a computer. Moreover, this number was obtained at the Department of Mathematics in one of the American departments. Numbers named after this scientist pass through the Luc-Lehmer primality test. However, science does not want to stop there. The Electronic Frontier Foundation, which was founded in 1990 in the United States of America (EFF), has offered a monetary reward for finding large primes. And if until 2013 the prize was given to those scientists who will find them from among 1 and 10 million decimal numbers, today this figure has reached from 100 million to 1 billion. Prizes range from 150 to 250 thousand US dollars.

Names of special prime numbers

Those numbers that were found thanks to algorithms created by certain scientists and passed the simplicity test are called special. Here are some of them:

1. Mersin.

4. Cullen.

6. Mills et al.

The simplicity of these numbers, named after the above scientists, is established using the following tests:

1. Lucas-Lemer.

2. Pepina.

3. Riesel.

4. Billhart - Lehmer - Selfridge and others.

Modern science does not stop there, and probably in the near future the world will know the names of those who were able to win a prize of 250,000 dollars by finding the largest prime number.


In this article, we will study prime and composite numbers. First, we give definitions of prime and composite numbers, and also give examples. After that, we prove that there are infinitely many prime numbers. Next, we write a table of prime numbers, and consider the methods for compiling a table of prime numbers, we will especially carefully dwell on the method called the sieve of Eratosthenes. In conclusion, we highlight the main points that need to be taken into account when proving that a given number is prime or composite.

Page navigation.

Prime and Composite Numbers - Definitions and Examples

The concepts of prime numbers and composite numbers refer to those that are greater than one. Such integers, depending on the number of their positive divisors, are divided into prime and composite numbers. So to understand definitions of prime and composite numbers, you need to have a good idea of ​​\u200b\u200bwhat divisors and multiples are.

Definition.

prime numbers are integers, greater than one, that have only two positive divisors, namely themselves and 1 .

Definition.

Composite numbers are integers greater than one that have at least three positive divisors.

Separately, we note that the number 1 does not apply to either prime or composite numbers. The unit has only one positive divisor, which is the number 1 itself. This distinguishes the number 1 from all other positive integers that have at least two positive divisors.

Considering that positive integers are , and that the unit has only one positive divisor, other formulations of the sounded definitions of prime and composite numbers can be given.

Definition.

Prime numbers are natural numbers that have only two positive divisors.

Definition.

Composite numbers are natural numbers that have more than two positive divisors.

Note that every positive integer greater than one is either a prime number or a composite number. In other words, there is not a single integer that is neither prime nor composite. This follows from the divisibility property, which says that the numbers 1 and a are always divisors of any integer a.

Based on the information in the previous paragraph, we can give the following definition of composite numbers.

Definition.

Natural numbers that are not prime are called constituent.

Let's bring examples of prime and composite numbers.

As examples of composite numbers, we give 6 , 63 , 121 and 6697 . This statement also needs an explanation. The number 6, in addition to positive divisors 1 and 6, also has divisors 2 and 3, since 6 \u003d 2 3, therefore 6 is really a composite number. The positive divisors of 63 are the numbers 1 , 3 , 7 , 9 , 21 and 63 . The number 121 is equal to the product of 11 11 , so its positive divisors are 1 , 11 and 121 . And the number 6697 is composite, since its positive divisors, in addition to 1 and 6697, are also the numbers 37 and 181.

In conclusion of this paragraph, I would also like to draw attention to the fact that prime numbers and coprime numbers are far from the same thing.

Prime number table

Prime numbers, for the convenience of their further use, are recorded in a table, which is called the table of prime numbers. Below is prime number table up to 1 000 .

A logical question arises: “Why did we fill out the table of prime numbers only up to 1,000, is it not possible to make a table of all existing prime numbers”?

Let's answer the first part of this question first. For most problems that involve prime numbers, primes up to a thousand will suffice. In other cases, most likely, you will have to resort to some special solution techniques. Although, of course, we can table prime numbers up to an arbitrarily large finite positive integer, whether it be 10,000 or 1,000,000,000 , in the next paragraph we will talk about methods for compiling tables of prime numbers, in particular, we will analyze the method called.

Now let's look at the possibility (or rather, the impossibility) of compiling a table of all existing prime numbers. We can't make a table of all the primes because there are infinitely many primes. The last statement is a theorem that we will prove after the following auxiliary theorem.

Theorem.

The smallest positive divisor of a natural number greater than 1 other than 1 is a prime number.

Proof.

Let a is a natural number greater than one, and b is the least positive non-one divisor of a. Let us prove that b is a prime number by contradiction.

Suppose b is a composite number. Then there is a divisor of the number b (let's denote it b 1 ), which is different from both 1 and b . If we also take into account that the absolute value of the divisor does not exceed the absolute value of the dividend (we know this from the properties of divisibility), then the condition 1

Since the number a is divisible by b by condition, and we said that b is divisible by b 1, then the concept of divisibility allows us to talk about the existence of such integers q and q 1 that a=b q and b=b 1 q 1 , whence a= b 1 ·(q 1 ·q) . From it follows that the product of two integers is an integer, then the equality a=b 1 ·(q 1 ·q) indicates that b 1 is a divisor of the number a . Taking into account the above inequalities 1

Now we can prove that there are infinitely many prime numbers.

Theorem.

There are infinitely many prime numbers.

Proof.

Let's assume it's not. That is, suppose that there are only n primes, and these primes are p 1 , p 2 , …, p n . Let us show that we can always find a prime number different from the indicated ones.

Consider a number p equal to p 1 ·p 2 ·…·p n +1 . It is clear that this number is different from each of the primes p 1 , p 2 , …, p n . If the number p is prime, then the theorem is proved. If this number is composite, then, by virtue of the previous theorem, there is a prime divisor of this number (let's denote it p n+1 ). Let's show that this divisor does not coincide with any of the numbers p 1 , p 2 , …, p n .

If this were not so, then by the properties of divisibility, the product p 1 ·p 2 ·…·p n would be divisible by p n+1 . But the number p is also divisible by p n+1, equal to the sum p 1 ·p 2 ·…·p n +1. This implies that the second term of this sum, which is equal to one, must be divisible by p n+1, and this is impossible.

Thus, it is proved that a new prime number can always be found, which is not contained among any number of prime numbers given in advance. Therefore, there are infinitely many prime numbers.

So, due to the fact that there are infinitely many prime numbers, when compiling tables of prime numbers, they always limit themselves from above to some number, usually 100, 1,000, 10,000, etc.

Sieve of Eratosthenes

Now we will discuss ways of compiling tables of prime numbers. Suppose we need to make a table of prime numbers up to 100 .

The most obvious method for solving this problem is to sequentially check positive integers, starting with 2 and ending with 100 , for the presence of a positive divisor that is greater than 1 and less than the number being checked (from the properties of divisibility, we know that the absolute value of the divisor does not exceed the absolute value of the dividend, different from zero). If such a divisor is not found, then the number being checked is prime, and it is entered in the table of prime numbers. If such a divisor is found, then the number being checked is composite, it is NOT entered into the table of prime numbers. After that, there is a transition to the next number, which is similarly checked for the presence of a divisor.

Let's describe the first few steps.

We start with the number 2. The number 2 has no positive divisors other than 1 and 2 . Therefore, it is prime, therefore, we enter it in the table of prime numbers. Here it should be said that 2 is the smallest prime number. Let's move on to number 3. Its possible positive divisor other than 1 and 3 is 2 . But 3 is not divisible by 2, therefore, 3 is a prime number, and it also needs to be entered in the table of prime numbers. Let's move on to number 4. Its positive divisors other than 1 and 4 can be 2 and 3 , let's check them. The number 4 is divisible by 2, therefore, 4 is a composite number and does not need to be entered in the table of prime numbers. Note that 4 is the smallest composite number. Let's move on to number 5. We check if at least one of the numbers 2 , 3 , 4 is its divisor. Since 5 is not divisible by either 2, or 3, or 4, it is prime, and it must be written in the table of prime numbers. Then there is a transition to the numbers 6, 7, and so on up to 100.

This approach to compiling a table of primes is far from ideal. One way or another, he has the right to exist. Note that with this method of constructing a table of integers, you can use divisibility criteria, which will slightly speed up the process of finding divisors.

There is a more convenient way to compile a table of primes called . The word “sieve” present in the name is not accidental, since the actions of this method help, as it were, to “sift” through the sieve of Eratosthenes integers, large units, in order to separate simple from compound ones.

Let's show the sieve of Eratosthenes in action when compiling a table of prime numbers up to 50.

First, we write down the numbers 2, 3, 4, ..., 50 in order.


The first number written 2 is prime. Now from the number 2 we sequentially move to the right by two numbers and cross out these numbers until we get to the end of the compiled table of numbers. So all numbers that are multiples of two will be crossed out.

The first non-crossed out number after 2 is 3 . This number is prime. Now, from the number 3, we sequentially move to the right by three numbers (taking into account the already crossed out numbers) and cross them out. So all numbers that are multiples of three will be crossed out.

The first non-crossed out number after 3 is 5 . This number is prime. Now, from the number 5, we sequentially move to the right by 5 numbers (we also take into account the numbers crossed out earlier) and cross them out. So all numbers that are multiples of five will be crossed out.

Next, we cross out numbers that are multiples of 7, then multiples of 11, and so on. The process ends when there are no numbers left to cross out. Below is a completed table of primes up to 50 obtained using the sieve of Eratosthenes. All uncrossed numbers are prime, and all crossed out numbers are composite.

Let's formulate and prove a theorem that will speed up the process of compiling a table of prime numbers using the sieve of Eratosthenes.

Theorem.

The least positive non-one divisor of a composite number a does not exceed , where is from a .

Proof.

We denote by the letter b the smallest divisor of the composite number a that differs from unity (the number b is prime, which follows from the theorem proved at the very beginning of the previous paragraph). Then there is an integer q such that a=b q (here q is a positive integer, which follows from the rules for multiplying integers), and (when b>q, the condition that b is the smallest divisor of a is violated, since q is also a divisor of a due to the equality a=q b ). Multiplying both sides of the inequality by a positive and greater than one integer b (we are allowed to do this), we obtain , whence and .

What does the proved theorem give us regarding the sieve of Eratosthenes?

First, the deletion of composite numbers that are multiples of a prime number b should begin with a number equal to (this follows from the inequality ). For example, crossing out numbers that are multiples of two should start with the number 4, multiples of three - with the number 9, multiples of five - with the number 25, and so on.

Secondly, the compilation of a table of prime numbers up to the number n using the sieve of Eratosthenes can be considered complete when all composite numbers that are multiples of prime numbers not exceeding are crossed out. In our example, n=50 (because we are tabulating primes up to 50 ) and , so the sieve of Eratosthenes must weed out all composite multiples of the primes 2 , 3 , 5 and 7 that do not exceed the arithmetic square root of 50 . That is, we no longer need to search and cross out numbers that are multiples of prime numbers 11 , 13 , 17 , 19 , 23 and so on up to 47 , since they will already be crossed out as multiples of smaller prime numbers 2 , 3 , 5 and 7 .

Is this number prime or composite?

Some tasks require finding out whether a given number is prime or composite. In the general case, this task is far from simple, especially for numbers whose record consists of a significant number of characters. In most cases, you have to look for some specific way to solve it. However, we will try to give direction to the train of thought for simple cases.

Undoubtedly, one can try to use divisibility criteria to prove that a given number is composite. If, for example, some criterion of divisibility shows that the given number is divisible by some positive integer greater than one, then the original number is composite.

Example.

Prove that the number 898 989 898 989 898 989 is composite.

Solution.

The sum of the digits of this number is 9 8+9 9=9 17 . Since the number equal to 9 17 is divisible by 9, then by the criterion of divisibility by 9 it can be argued that the original number is also divisible by 9. Therefore, it is composite.

A significant drawback of this approach is that the criteria for divisibility do not allow us to prove the simplicity of a number. Therefore, when checking a number for whether it is prime or composite, you need to proceed differently.

The most logical approach is to enumerate all possible divisors of a given number. If none of the possible divisors is a true divisor of a given number, then that number is prime; otherwise, it is composite. From the theorems proved in the previous paragraph, it follows that the divisors of a given number a must be sought among prime numbers not exceeding . Thus, the given number a can be successively divided by prime numbers (which are convenient to take from the table of prime numbers), trying to find the divisor of the number a. If a divisor is found, then the number a is composite. If among the prime numbers not exceeding , there is no divisor of the number a, then the number a is prime.

Example.

Number 11 723 simple or compound?

Solution.

Let's find out to what prime number the divisors of the number 11 723 can be. For this, we estimate .

It is quite obvious that , since 200 2 \u003d 40 000, and 11 723<40 000 (при необходимости смотрите статью number comparison). Thus, the possible prime divisors of 11,723 are less than 200. This already greatly simplifies our task. If we did not know this, then we would have to sort through all the prime numbers not up to 200, but up to the number 11 723 .

If desired, you can estimate more accurately. Since 108 2 \u003d 11 664, and 109 2 \u003d 11 881, then 108 2<11 723<109 2 , следовательно, . Thus, any of the primes less than 109 is potentially a prime divisor of the given number 11,723.

Now we will sequentially divide the number 11 723 into prime numbers 2 , 3 , 5 , 7 , 11 , 13 , 17 , 19 , 23 , 29 , 31 , 37 , 41 , 43 , 47 , 53 , 59 , 61 , 67 , 71 , 73 , 79 , 83 , 89 , 97 , 101 , 103 , 107 . If the number 11 723 is divided entirely by one of the written prime numbers, then it will be composite. If it is not divisible by any of the written prime numbers, then the original number is prime.

We will not describe this whole monotonous and monotonous process of division. Let's just say that 11 723

List of divisors. By definition, the number n is prime only if it is not evenly divisible by 2 and any integers other than 1 and itself. The above formula removes unnecessary steps and saves time: for example, after checking if a number is divisible by 3, there is no need to check if it is divisible by 9.

  • The floor(x) function rounds x to the nearest integer less than or equal to x.

Learn about modular arithmetic. The operation "x mod y" (mod is short for the Latin word "modulo", meaning "module") means "divide x by y and find the remainder". In other words, in modular arithmetic, upon reaching a certain value, which is called module, the numbers "turn" back to zero. For example, a clock measures time in modulus 12: it shows 10, 11, and 12 o'clock and then returns to 1.

  • Many calculators have a mod key. The end of this section shows how to manually calculate this function for large numbers.
  • Learn about the pitfalls of Fermat's Little Theorem. All numbers for which the test conditions are not met are composite, but the remaining numbers are only probably are considered simple. If you want to avoid incorrect results, look for n in the list of "Carmichael numbers" (composite numbers that satisfy this test) and "pseudo-prime Fermat numbers" (these numbers meet the conditions of the test only for some values a).

    If convenient, use the Miller-Rabin test. Although this method is rather cumbersome for manual calculations, it is often used in computer programs. It provides acceptable speed and gives less errors than Fermat's method. A composite number will not be taken as a prime number if calculations are made for more than ¼ values a. If you randomly select different values a and for all of them the test will give a positive result, we can assume with a fairly high degree of confidence that n is a prime number.

  • For large numbers, use modular arithmetic. If you don't have a mod calculator handy, or if your calculator isn't designed to handle such large numbers, use the power properties and modular arithmetic to make calculations easier. Below is an example for 3 50 (\displaystyle 3^(50)) mod 50:

    • Rewrite the expression in a more convenient form: mod 50. When calculating manually, further simplifications may be necessary.
    • (3 25 ∗ 3 25) (\displaystyle (3^(25)*3^(25))) mod 50 = mod 50 mod 50) mod 50. Here we have taken into account the property of modular multiplication.
    • 3 25 (\displaystyle 3^(25)) mod 50 = 43.
    • (3 25 (\displaystyle (3^(25)) mod 50 ∗ 3 25 (\displaystyle *3^(25)) mod 50) mod 50 = (43 ∗ 43) (\displaystyle (43*43)) mod 50.
    • = 1849 (\displaystyle =1849) mod 50.
    • = 49 (\displaystyle=49).
  • Task 2.30
    Given a one-dimensional array A, consisting of natural numbers. Display the number of primes in the array.

    First, let me remind you what prime numbers are.

    And now let's move on to the task. In essence, we need a program that determines prime numbers. And to sort through the elements in and check their values ​​is a matter of technology. At the same time, we can not only calculate, but also display the prime numbers of the array.

    How to determine a prime number in Pascal

    I will give a solution algorithm with a detailed analysis in Pascal. You can see the solution in the example C++ program.

    IMPORTANT!
    Many people may be wrong about this. The definition says that a prime number has smooth two different divider. Therefore, the number 1 is not prime (it is also not prime, since zero can be divided by any number).

    To check whether a number is prime, we will use , which we will create ourselves. This function will return TRUE if the number is prime.

    In the function, we will first check if the number is less than two. If yes, then it is no longer a prime number. If the number is equal to 2 or 3, then it is uniquely prime and no additional checks are required.

    But if the number N is greater than three, then in this case we will loop over all possible divisors, starting from 2 to (N-1). If the number N is divisible by some divisor without a remainder, then this is also not a prime number. In this case, we break the loop (because there is no point in checking further), and the function returns FALSE.

    There is no point in checking if a number is divisible by itself (so the loop only lasts up to N-1).

    I will not give the function itself here - look at it in the program examples.

    Solution of problem 2.30 in Pascal mytask; //************************************************** **************** // CONSTANTS //********************************* *********************************** COUNT = 100; //Number of elements in the array //********************************************* ********************** // FUNCTIONS AND PROCEDURES //************************* ********************************************** //***** ******************************************************* ********* // Checks if number is prime // INPUT: N - number // OUTPUT: TRUE - N is prime, FALSE - not prime //********** ******************************************************* **** IsPrimeNumber(N: WORD) : ; var i: ; start := TRUE; N of 0..3: begin N Exit; end; end; i:= 2 to (N-1) do if (N i) = 0 then //Not a prime number begin Result:= FALSE; ; end; end; i: WORD; X: WORD=0; A: of WORD; //************************************************** **************** // MAIN PROGRAM //**************************** ************************************ begin //Fill the array with numbers for i:= 1 to COUNT do A[i] := i; // Count and select prime numbers from array for i:= 1 to COUNT do if IsPrimeNumber(A[i]) then begin (X); Write(A[i], " "); end; (#10#13"Number of Prime numbers = ", X); WriteLn("The end. Press ENTER..."); ; end.

    Solution of problem 2.30 in C++#include #include using namespace std; //************************************************** **************** // CONSTANTS //********************************* *********************************** const int COUNT = 100; //Number of elements in the array //********************************************* ********************** // FUNCTIONS AND PROCEDURES //************************* ********************************************** //***** ******************************************************* ********* // Checks if number is prime // INPUT: N - number // OUTPUT: TRUE - N is prime, FALSE - not prime //********** ******************************************************* **** bool IsPrimeNumber(int N) ( bool Res = true; switch (N) ( case 0: Res = false; break; case 1: Res = false; break; case 2: Res = true; break; case 3 : Res = true; break; default: for (int i = 2; i