The Curiosity About Prime Numbers

Everybody knows prime numbers. Most of us like prime numbers. Many of us love prime numbers. Some of us have noticed some curious things about prime number. Let me mention some of them:

2 – the curious thing about the prime number 2 is obvious – it is the smallest prime
3 – the smallest odd prime
11 – the smallest 2-digital prime
16 – the smallest number that is the fourth degree of some prime

Etc..

So, if we keep our mind busy thinking about curiosity of small integers, we will certainly be able to think of something interesting (related to primes) about every positive integer. But how far can we go? OK, we can think curious things about integers smaller than 10 – I’ll assume everyone can do that. Well, maybe we can assign a curio to every integer smaller than 100 as well. I guess, not everyone could do it so well this time, but, in fact, it could be possible for some of us. But what’s next? Can we go further till 1000? Can somebody tell me, for example, what is the curiosity about the integer 857 (it must be related to prime numbers)? Not instantly, I guess.. Therefore I was amazed by the theorem I found in this site:

Theorem. Every positive integer n has an associated prime curio.

And do you know what? There exists a proof for this theorem as well:

Proof: Let S be the set of positive integers for which there is no associated prime curiosity.  If S is empty, then we are done.  So suppose, for proof by contradiction, that S is not empty.  By the well-ordering principle S has a least element, call it n.  Then n is the least positive integer for which there is no associated prime curio.  But our last statement is a prime curio for n, a contradiction showing S does not have a least element and completing the proof.

Well, I don’t know about you, my dear reader, but I found this proof very exiting. It actually means we could think of a prime curiosity for every positive integer, if only we thought hard enough and long enough. Very beautiful result, indeed!

What Does This Function Do?

1. Please, give your answers in comments – what does the function written below do:

a)      recognizes prime numbers

b)      recognizes prime numbers in interval [100;999]

c)      neither a) nor b) is correct

d)      other variant (please, specify)

2. And the second question is – is this function a correct solution if the task is as follows: `Please, write a function that recognizes all the prime numbers consisting of exactly 3 digits`:

a) yes

b) no

The function (in C++):

bool f(int x) {

 for (int y=2;y<x;y++)

  if (x%y==0) return false;

 return true;

}

P.S. I wish all of you wrote your thoughts in order to make a student of mine understand the essence of the thing!