Floor Primes

For how many positive integers n n are there exactly n 2 \lfloor \frac{n}{2} \rfloor or n 2 \lceil \frac{n}{2} \rceil primes less than or equal to n n ?

Details and assumptions

Greatest Integer Function / Floor Function: x : R Z \lfloor x \rfloor: \mathbb{R} \rightarrow \mathbb{Z} refers to the greatest integer less than or equal to x x . For example 2.3 = 2 \lfloor 2.3 \rfloor = 2 and 5 = 5 \lfloor -5 \rfloor = -5 .
Ceiling Function: x : R Z \lceil x \rceil : \mathbb{R} \rightarrow \mathbb{Z} refers to the smallest integer that is greater than or equal to to x x . For example, 2.3 = 3 \lceil 2.3 \rceil = 3 and 5 = 5 \lceil -5 \rceil = -5 .


The answer is 11.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

12 solutions

We will prove that there are 11 11 values of n n in which there are exactly n 2 \lfloor \frac{n}{2} \rfloor or n 2 \lceil \frac{n}{2} \rceil primes less than or equal to n n .

First, we list the first 10 10 primes, which are: 2 , 3 , 5 , 7 , 11 , 13 , 17 , 23 , 29 , 31 2, 3, 5, 7, 11, 13, 17, 23, 29, 31 .

The smallest prime number is 2 2 , so there 1 2 = 0 \lfloor \frac{1}{2} \rfloor = 0 primes for n = 1 n = 1 , which is true.

For even values of n n where 2 n 8 2 \le n \le 8 , there are exactly n 2 \frac{n}{2} prime numbers.

For odd values of n n where 3 n 7 3 \le n \le 7 , there are n 2 \lceil \frac{n}{2} \rceil prime numbers.

For n = 9 , 11 , 13 n = 9, 11, 13 . there are n 2 = 4 \lfloor \frac{n}{2} \rfloor = 4 prime numbers.

Now we shall prove that the maximum value of n n is 13 13 : The next (7th) prime number is 17 17 , while for n = 14 , 15 , 16 n = 14, 15, 16 , the values of n 2 \lfloor \frac{n}{2} \rfloor and n 2 \lceil \frac{n}{2} \rceil is equal to either 7 7 or 8 8 .

Similarly, 17 2 = 8 \lfloor \frac{17}{2} \rfloor = 8 , which is greater than the number of prime numbers which is less than or equal to 17 17 .

Thus for n > 13 n > 13 , n 2 \lfloor \frac{n}{2} \rfloor is always greater than the number of primes less than or equal to n n , since the distance between each prime number is generally becoming larger for n > 13 n > 13 .

Most solutions submitted for this problem were not well written and did not adequately justify their answers. Students often listed a set of 11 values of n n that they claimed satisfied the relation and mentioned that for larger values of n n it was not possible. It was then poorly (or not at all) justified why either of these was the case.

Calvin Lin Staff - 7 years ago

Log in to reply

Could we use the prime counting function properties here?

Sergei Krestianskov - 5 years, 4 months ago
Phalguni Shah
Aug 12, 2013

for n=14, floor(n)=7 and ceiling(n)=7. but there are only 6 primes before 15. now, everytime as n increases by 2, both floor and ceiling values increase by 1, but the number of primes less than n need not always increase and even if it does it does so by atmost 1. so any n>=14 cannot satisfy the condition. Hence, we have to check individually for numbers 1 to 13, for both floor and ceiling of n/2. We find that 1,2,3,....,8,9,11 and 13(11 numbers) satisfy the condition.

How does 1 satisfy the problem

Demon Devil - 7 years, 10 months ago

Log in to reply

Because floor(1/2) = 0, so there are 0 prime less than or equal to 1. which satisfy the conditions. That was pretty tricky.

Jack Lian - 7 years, 10 months ago
David Nolasco
May 20, 2014

List down the first primes- 2, 3, 5, 7, 11, 13, 17, ... Notice that 7th prime(17) has an n/2 value of 8.5 which excludes it from the possible solutions. So the only solutions would be 1(0 prime), 2(1 prime), 3(2 primes) up to 9(4 primes), 11(5 primes) and 13(6 primes)

Zeming Lin
May 20, 2014

The solution space is enough for a brute force search. Observe that for n = 17 n = 17 , there are 7 primes smaller or equal to it and 17 2 = 9 \lceil \frac {17}{2} \rceil = 9 . For n 17 n \geq 17 , each next prime is at least 2 larger than the previous so there are no more after 17. We then list all the numbers from 1 to 16 and check them all, finding that 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, and 13 are solutions.

Lê Minh Thắng
May 20, 2014

We first calculate and find 11 numbers that fix the question: 1,2,3,4,5,6,7,8,9,11,13. We prove that for n>13 there will not be any numbers that satisfy the condition. First, if n is even then there will be n 2 \frac{n}{2} even numbers that cannot be primes and the remain odd numbers can't be all primes (it already has 9). Odd number n is the same (the first is 15 and it has 2 odd numbers: 9 and 15 for all n 15 n\geq15 )

Stella Marie
May 20, 2014

There are 8 where π(n) = the prime counting function = floor(n/2), 7 where it = ceiling(n/2) and 11 where it = one or the other.

n = 13 is the largest integer where any of the above occurs. For n = 14 or 15, there are only 6 primes <= n, and n/2 grows faster than π(n).

Zi Song Yeoh
Oct 21, 2013

If n 15 n \ge 15 , then all even integers n \le n greater than 2 2 , 1 1 , 9 9 and 15 15 are not primes, so there will be less than n 2 \lfloor\frac{n}{2}\rfloor primes. Thus, a simple check for n 15 n \le 15 shows that only n = 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 11 , 13 n = 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13 work, with a total of 11 \boxed{11} numbers.

I have already solved this problem, 2 months 1 week ago!

Juan rodrígez - 7 years, 7 months ago

Log in to reply

I think I did, too.

Zi Song Yeoh - 7 years, 7 months ago

how is 1 a prime number?

Abhay Gupta - 7 years, 7 months ago

Log in to reply

Who said it is?

Rishabh Sharma - 7 years, 7 months ago

Actually one is neither prime nor composite...

Harrison Lian - 7 years, 7 months ago

13 is the 6th prime and 13/2 = 6.5

17 is the 7th prime and 17/2 = 8.5 so we don't need to check for n>=14.

from 1-13 there are 11 number (1,2,3,4,5,6,7,8,9,11,13)satisfy the condition.

Mirza Baig
Oct 20, 2013

Inspection shows that 1, 2, 3, 4, 5, 6, 7, 8, 9, 11 and 13 satisfy the required condition.

14, 15 and 16 have 6 primes less than or equal to them. Thus they don't follow the condition.

Assertion: If 2n-1 doesn't follow the condition, then 2n and 2n+1 don't follow the condition either, for all n>1

Proof: Define P(n) = Number of primes less than or equal to n.

1) 2n-1 doesn't follow the condition implies, P(2n-1) < \floor 2 n 1 \floor{2n-1} < \ceil 2 n 1 \ceil{2n-1}

2) P(2n-1) = P(2n) because 2n can't be prime. 3) \ceil 2 n 1 \ceil{2n-1} = \floor 2 n \floor{2n} = \ceil 2 n \ceil{2n}

This gives,

4) P(2n) < \floor 2 n \floor{2n} = \ceil 2 n \ceil{2n} , hence 2n doesn't follow the condition.

5) P(2n+1) - P(2n-1) = 0 or 1. (If 2n+1 is prime then it's 1 else 0.) 6) \floor 2 n 1 \floor{2n-1} + 1 = \floor 2 n + 1 \floor{2n+1} < \ceil 2 n + 1 \ceil{2n+1}

This gives 7) P(2n+1) < \floor 2 n + 1 \floor{2n+1} < \ceil 2 n + 1 \ceil{2n+1} , hence 2n+1 also doesn't satisfies the condition.

Now by induction all the integers beyond 15 don't follow the condition.

Sayan Chaudhuri
May 20, 2014

Let's look at the numbers one by one. The boldfaced numbers are prime themselves.

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13

That is a total of 11 numbers from 1 to 13 which meet the condition. Please note that 10 and 12 are not the solutions to the problem, hence don't feature in the list.

In the hope of finding more solutions, let's randomly pick 20 as our guess. There are 8 primes less than or equal to 20, which is two less than n/2[where n=20]...Now we claim that there are no solutions beyond this point. Let's see why:

In every pair of numbers we look at next, one of them is even, hence it can't be a prime. Thus we would want the odd number in the pair to be a prime, in order to keep up with the increasing . Going forward (after 13), primes start getting rare. That means we won't find as many prime numbers per (say) 10 numbers as you found them till this point. For example from 20 to 30, we come across only 2 primes (23 and 29) where as increases by 10. We should have added at least 5 primes so as to meet the condition, which clearly didn't happen. So the final answer to this question should be 11.

Please let me know if anything is flawed in the logic. Thanks. please give me some good many points..................thanking you......

Sayan Chaudhuri
May 20, 2014

Let's look at the numbers one by one. The boldfaced numbers are prime themselves.

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13

That is a total of 11 numbers from 1 to 13 which meet the condition. Please note that 10 and 12 are not the solutions to the problem, hence don't feature in the list.

In the hope of finding more solutions, let's randomly pick 20 as our guess. There are 8 primes less than or equal to 20, which is two less than n/2 . Now we claim that there are no solutions beyond this point. Let's see why:

In every pair of numbers we look at next, one of them is even, hence it can't be a prime. Thus we would want the odd number in the pair to be a prime, in order to keep up with the increasing . Going forward (after 13), primes start getting rare. That means we won't find as many prime numbers per (say) 10 numbers as you found them till this point. For example from 20 to 30, we come across only 2 primes (23 and 29) where as n increases by 10. We should have added at least 5 primes so as to meet the condition, which clearly didn't happen. So the final answer to this question should be 11.

Please let me know if anything is flawed in the logic. Thanks. Thanks once again..............

Copied from http://www.quora.com/Mathematics/For-how-many-positive-integers-n-are-there-exactly-⌊n-2⌋-or-⌈n-2⌉-primes-less-than-or-equal-to-n

Calvin Lin Staff - 7 years ago

Only the numbers 1 to 9, 11, 13 verify th econdition !!!

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...