n! is really even

How many positive integers n < 1000 n<1000 are there, such that n ! n! is divisible by 2 n 1 2^{n-1} ?


The answer is 10.

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.

8 solutions

C Lim
Aug 18, 2013

The maximum power of 2 which divides n ! n! is given by:

S ( n ) : = [ n 2 ] + [ n 4 ] + [ n 8 ] + S(n) := \left[ \frac n 2\right] + \left[ \frac n 4\right] + \left[ \frac n 8\right] + \ldots

First note that S ( n ) n 1 S(n) \le n-1 since the infinite sequence n 2 + n 4 + n 8 + \frac n 2 + \frac n 4 + \frac n 8 + \ldots equals n n and so S ( n ) n S(n) \le n ; but equality cannot hold since that would require [ n 2 k ] = n 2 k \left[\frac n {2^k}\right] = \frac n{2^k} for all k k , which is impossible for positive n n . Since S ( n ) S(n) is an integer, we must have S ( n ) n 1 S(n) \le n-1 .

Next, [ 1 j [ n k ] ] = [ n j k ] \left[\frac 1 j \left[ \frac n k\right]\right] = \left[ \frac n {jk} \right] for positive integers n , j , k n, j, k , so:

S ( n ) = [ n 2 ] + S ( [ n / 2 ] ) . S(n) = \left[ \frac n 2\right] + S( [n/2] ).

We say that a positive integer n n is brilliant if S ( n ) = n 1 S(n) = n-1 .

Claim 1 : n = 1 n=1 is brilliant.

Claim 2 : if n > 1 n>1 is odd, then it's not brilliant.

Proof : Write n = 2 j 1 n = 2j-1 for an integer j 1 j \ge 1 . Then [ n 2 ] = j 1 \left[ \frac n 2\right] = j-1 so we have S ( n ) = j 1 + S ( j 1 ) j 1 + ( j 2 ) = 2 j 3 < n 1 S(n) = j-1 + S(j-1) \le j-1 + (j-2) = 2j-3 < n-1

and the result follows.

Claim 3 : n = 2 k n=2k is brilliant if and only if k k is brilliant.

Proof : Again, since [ n 2 ] = k \left[\frac n 2\right] = k we have S ( n ) = k + S ( k ) S(n) = k + S(k) , so S ( n ) = n 1 S(n) = n-1 holds if and only if S ( k ) = k 1 S(k) = k-1 , so the result follows.

From the above claims, n n is brilliant if and only if it's a power of 2.

Moderator note:

Very elegant solution!

Brilliant!

Alexander Borisov - 7 years, 9 months ago

would you please explain in more easier way

jinay patel - 7 years, 9 months ago

Log in to reply

You may want to look at Victor C.'s solution. It is more explicit, and, in particular, does not use induction. So you will probably find it easier to understand. I do encourage you to work through the C L.'s solution. To understand it better, try plugging in some particular small values of n . n.

Alexander Borisov - 7 years, 9 months ago
Victor Chaves
Aug 19, 2013

We can see that if n = 2 k n = 2^k for some positive integer k k and the function π 2 ( n ) \pi_2(n) giving the number of prime factors 2 in n n , we have: π 2 ( 2 k ! ) = 2 k 1 + π 2 ( 2 k 1 ! ) π 2 ( 2 k ! ) = 2 k 1 \pi_2(2^k!) = 2^{k-1} + \pi_2(2^{k-1}!) \Rightarrow \pi_2(2^k!) = 2^k-1 And hence, π 2 ( n ! ) = n 1 2 n 1 n ! \pi_2(n!) = n - 1 \Rightarrow 2^{n-1} | n!

Otherwise, having n = 2 k + m n = 2^k+m with 0 < m < 2 k 0<m<2^k , we have: π 2 ( ( 2 k + m ) ! ) = π 2 ( 2 k ! ) + π 2 ( m ! ) \pi_2((2^k+m)!) = \pi_2(2^k!) + \pi_2(m!) \Rightarrow π 2 ( n ) = 2 k 1 + π 2 ( m ) = π 2 ( m ! ) + n m 1 \pi_2(n) = 2^k-1+\pi_2(m) = \pi_2(m!) + n-m-1

We must investigate if π 2 ( n ! ) n 1 \pi_2(n!) \geq n-1 , but from last result we have: π 2 ( n ! ) = π ( m ! ) + n m 1 n 1 π 2 ( m ! ) m \pi_2(n!) = \pi(m!)+n-m-1 \geq n-1 \Rightarrow \pi_2(m!) \geq m

And that's impossible, because obviously n = 2 k n = 2^k is the best case possible and π 2 ( n ! ) < n \pi_2(n!) < n .

So, the only solutions are n = 2 k n = 2^k , k { 0 , 1 , . . . , 9 } k \in \{0,1,...,9\}

Moderator note:

Nice job! Very explicit and straight to the point.

I think you need to explain why "obviously n = 2 k n=2^k is the best case possible".

Ryan Soedjak - 7 years, 9 months ago

Log in to reply

You're right, I was trying to make the solution smaller and jumped that part.

For any n n , we find k k such that 2 k 1 < n 2 k 2^{k-1}< n \leq 2^k and proceed with the following implications:

π 2 ( n ! ) = π 2 ( 1 × 2 × . . . × n ) = π 2 ( 2 × 4 × . . . × 2 n 2 ) = \pi_2(n!) = \pi_2 (1\times2\times ... \times n) = \pi_2 (2\times4\times ... \times 2\left\lfloor \frac{n}{2} \right\rfloor ) = n 2 + π ( n 2 ! ) \left\lfloor \frac{n}{2} \right\rfloor + \pi(\left\lfloor \frac{n}{2} \right\rfloor!)

So we define m 1 = n 2 m_1 = \left\lfloor \frac{n}{2} \right\rfloor , keeping in mind that 2 m 1 n 2*m_1 \leq n , holding equality if and only if n n is even.

So now we have π 2 ( n ! ) = m 1 + π 2 ( m 1 ! ) \pi_2(n!) = m_1 + \pi_2(m_1!) , and we keep doing this until the function π 2 \pi_2 vanishes from the sum. In the end:

π 2 ( n ! ) = m 1 + m 2 + . . . \pi_2(n!) = m_1 + m_2 + ...

and from the inequality 2 m k + 1 m k 2*m_{k+1} \leq m_k , we can say m k 2 k 1 m_k \leq 2^{k-1} and hence

π 2 ( n ! ) 2 k 1 + 2 k 2 + . . . + 1 \pi_2(n!) \leq 2^{k-1} + 2^{k-2} + ... +1

Having equality if and only if for each k k , 2 m k + 1 = m k 2*m_{k+1} = m_k . So equality holds when n n divided consecutively by 2 2 is always even (or 1), which means, n n is power of 2.

This is another way of proving the first result, since we now end up with the sum:

π 2 ( n ! ) = i = 0 k 1 2 i = 2 k 1 = n 1 \pi_2(n!) = \sum_{i=0}^{k-1} 2^i = 2^k - 1 = n-1

Victor Chaves - 7 years, 9 months ago

Log in to reply

Yes, this inequality is not totally obvious. However, the first few lines of the C.L's solution provide an easy proof (change n n to m m ). Your argument also works.

Alexander Borisov - 7 years, 9 months ago

Sorry, there is a typo. I forgot about the " ! ". The 4th equation line should be: π 2 ( n ! ) = 2 k 1 + π 2 ( m ! ) = π 2 ( m ! ) + n m 1 \pi_2(n!) = 2^k-1 + \pi_2(m!) = \pi_2(m!)+n-m-1

Victor Chaves - 7 years, 9 months ago
Ryan Soedjak
Aug 22, 2013

We claim that 2 n 1 n ! 2^{n-1}|n! if and only if n n is a power of 2 2 .

First, recall by Legendre's Theorem that the largest power of 2 2 that divides n ! n! is f ( n ) = n 2 + n 2 2 + n 2 3 + f(n)=\left\lfloor \frac{n}{2}\right \rfloor+\left\lfloor \frac{n}{2^2}\right\rfloor+\left\lfloor \frac{n}{2^3}\right\rfloor+\cdots (Call it f ( n ) f(n) for convenience.) Thus, the claim is equivalent to showing that f ( n ) n 1 f(n)\ge n-1 if and only if n n is a power of 2 2 . In fact, we will prove the stronger statement:

Lemma: f ( n ) = n 1 f(n)=n-1 if n n is a power of 2 2 and f ( n ) < n 1 f(n)<n-1 otherwise.

Proof: If n n is a power of 2 2 , then we can write n = 2 m n=2^m for some nonnegative integer m m , and f ( n ) = 2 m 1 + 2 m 2 + + 1 = 2 m 1 = n 1 f(n)=2^{m-1}+2^{m-2}+\cdots+1=2^m-1= n-1 as expected.

Now we use induction to prove that if n n is not a power of 2 2 , then f ( n ) < n 1 f(n)<n-1 . We will prove that for all positive integers m 2 m\ge 2 , every positive integer n n less than 2 m 2^m that is not a power of 2 2 satisfies f ( n ) < n 1 f(n)<n-1 . The base case m = 2 m=2 is trivial since f ( 3 ) = 1 < 3 1 f(3)=1<3-1 . Now assume the statement holds for some m = k m=k . To prove that it is true for m = k + 1 m=k+1 we need to show that for all 2 k < n < 2 k + 1 2^k<n<2^{k+1} that are not powers of 2 2 , f ( n ) < n 1 f(n)<n-1 . Note that n n can be written as n = 2 k + a n=2^k+a for some 0 < a < 2 k 0<a<2^k . Thus f ( n ) = f ( 2 k + a ) = 2 k 1 + a 2 + 2 k 2 + a 2 2 + = 2 k 1 + 2 k 2 + + 1 + f ( a ) = 2 k 1 + f ( a ) 2 k 1 + ( a 1 ) = 2 k + a 2 < 2 k + a 1 \begin{aligned} f(n)=f(2^k+a)&=&2^{k-1}+\left\lfloor \frac {a}{2}\right \rfloor+2^{k-2}+\left \lfloor \frac{a}{2^2}\right \rfloor+\cdots \\ &=& 2^{k-1}+2^{k-2}+\cdots+1+f(a)\\ &=&2^k-1+f(a)\\ &\le& 2^k-1+(a-1)\\ &=&2^k+a-2\\ &<&2^k+a-1 \end{aligned} which completes the induction. \square

Thus the claim at the beginning is proved and it only remains to compute the number of powers of 2 2 less than 1000 1000 . Since 2 9 < 1000 < 2 10 2^9<1000<2^{10} , the answer is 9 + 1 = 10 9+1=\boxed{10} .

Opel Berlin
Aug 19, 2013

My way is listing the disibility of n! By 2^(n-1) from n=1 until I found the pattern

List => n=1 -> 1|1 => n=2 -> 2|2 => n=3 -> not => n=4 -> 8|24 => n=5 -> not . . . . => n=8 -> 128|40320 => n=9 -> not => n=10 -> not

From this list , we not for every n which can be formed as 2^k , with k positve integers , 2^(n-1) divide n! So n=2^0 , 2^1 , 2^2 , ... , 2^9 ->> We get 10 solutions

Sorry I can't wrtite latex

Opel Berlin - 7 years, 9 months ago

The answer is correct, but can you justify your pattern?

Alexander Borisov - 7 years, 9 months ago

that's how I did it

Utkarsh Mehra - 7 years, 9 months ago

Log in to reply

I know utkarsh, that's how you did it.... But how can you justify the fact that the statement holds for no number other than the powers of 2? Either you have gone with your instincts (which is totally non-mathematical) or you have used calculator and tested all the numbers which is much more non-mathematical. In my solution I form a conjecture that this statement holds for the powers of 2, then i prove it using GP (geometric progression). Then I form another conjecture that this statement holds for no numbers other than the powers of 2. For the proof of this I assume that the statement holds for a number between (2^k) and [2^(k+1)]. Then I bound all the floor functions using two or three tricks and show their infinite sum to be less than 2^(k+1) - n - 1. The contradiction proves the statement. I cannot describe the tricks in bounding the infinite sum of floor functions (although they were quite simple) due to lack of knowledge in lateX.

Siddharth Kumar - 7 years, 9 months ago
Aaron Doman
Aug 21, 2013

The highest power of 2 that divides n ! n! is n 2 + n 4 + . \lfloor{\frac{n}{2}\rfloor}+\lfloor{\frac{n}{4}\rfloor}+\cdots. Note that this is less than n 2 + n 4 + = n . \frac{n}{2}+\frac{n}{4}+\cdots=n. One can probably guess that n 2 + n 4 + = n 1 \lfloor{\frac{n}{2}\rfloor}+\lfloor{\frac{n}{4}\rfloor}+\cdots=n-1 when n n is a power of two. Indeed, 2 k 2 + 2 k 4 + = 2 k 1 + 2 k 2 + + 1 = 2 k 1. \lfloor{\frac{2^k}{2}\rfloor}+\lfloor{\frac{2^k}{4}\rfloor}+\cdots=2^{k-1}+2^{k-2}+\cdots+1=2^k-1. If n n is not a power of two, then we have 2 k < n < 2 k + 1 2^{k}<n<2^{k+1} for some integer k k . But then n 2 k = 0 \lfloor{\frac{n}{2^k}\rfloor}=0 and thus n 2 + n 4 + + n 2 k n 2 + n 4 + + n 2 k 1 + 0 \lfloor{\frac{n}{2}\rfloor}+\lfloor{\frac{n}{4}\rfloor}+\cdots+\lfloor{\frac{n}{2^k}\rfloor} \le \frac{n}{2}+\frac{n}{4}+\cdots+\frac{n}{2^{k-1}}+0 = ( 2 k 1 1 ) n 2 k 1 =\frac{(2^{k-1}-1)n}{2^{k-1}} < n 1 , <n-1, a contradiction. Thus, only n = 1 , 2 , . . . , 512 n=1,2,...,512 work, so there are 10 solutions.

Small typo: near the middle of the solution it should read "If n n is not a power of two, then we have 2 k 1 < n < 2 k 2^{k-1}<n<2^{k} for some integer k k " (rather than 2 k < n < 2 k + 1 2^k<n<2^{k+1} ).

Ryan Soedjak - 7 years, 9 months ago

Log in to reply

You are correct; thank you for catching that.

Aaron Doman - 7 years, 9 months ago
Akash A N
Aug 20, 2013

if we try for the first few numbers, we find that every number that can be expressed as 2 power n satisfies the equation( 2^0=1;2^1=2;2^2=4.......2^9=512) therefore 10 numbers

This is not a solution!!

Zi Song Yeoh - 7 years, 9 months ago

Log in to reply

Can you justify your pattern?

Zi Song Yeoh - 7 years, 9 months ago

I mean a correct one.

Zi Song Yeoh - 7 years, 9 months ago

how does this yield to answer?

Srinivas Devulapalli - 7 years, 9 months ago

Now I got the logic. Yes your solution is perfect.Thannks.

Srinivas Devulapalli - 7 years, 9 months ago
Elijah Tan
Aug 22, 2013

It can be divided as long as the degree of 2 in n! is greater than or equal to (n-1). This condition is fulfilled when n is one of the power of 2. Every time n=2^a, flooring (2^a/2) gives ((2^a)-1)) which is (n-1). So total there are 9 possibilities from this method (2, 4, 8, 16, 32, 64, 128, 256, 512), and including the fact that n=1 (2^0) is also an answer, there are total 10 possibilities.

1,2,4,16,32,64,128,256,512 the logic is double of the number satidfies the condition

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...