If ( r n n ) is an even number for natural numbers r n < n and denote R n as the smallest possible value of r n , find the value of n less than 1 0 4 such that its corresponding R n is maximized.
Details and Assumptions :
Bonus : Can you generalize this for some constant M such that n < M ?
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.
Using a Python program, I noticed that R n m a x = 2 k are powers of 2 . It is also noticed that:
\(\begin{array} {} k = 0 & \Rightarrow n_0 = 2 & k = 1 & \Rightarrow n_1 = 5 & k = 2 & \Rightarrow n_2 = 11 \\ k = 3 & \Rightarrow n_3 = 23 & k = 4 & \Rightarrow n_4 = 47 & ... & \Rightarrow n_k = 3(2^k)-1 & \end{array} \)
Therefore, the largest
n k < 1 0 0 0 0 ⇒ 3 ( 2 k ) < 1 0 0 0 0 ⇒ lo g 3 + k lo g 2 < 4 ⇒ k < lo g 2 4 − lo g 3 = 1 1 . 7 ⇒ k = 1 1 ⇒ n 1 1 = 3 ( 2 1 1 ) − 1 = 6 1 4 3
I have used a spreadsheet to plot out a Pascal Triangle with even coefficients shown as 0 and odd, 1 . You can check the first few n k with it.
But you need to prove that it must be of the form 3 ( 2 k ) − 1 or why must R n max be a power of 2 .
Cool! Sierpinski triangle! I didn't expect that!
Log in to reply
I knew what I provided is inadequate. I was trained an engineer don't like to proof stuff. Let me look at it again.
Log in to reply
Hint hint: see title of this very webpage.
Log in to reply
@Pi Han Goh – DAMN IT! I got the answer after following the pattern and entered Rn instead of n! I too tried to answer it with a program and ended up making two guesses that were wrong. Just my luck. Or it's my imprudence. Once I start on a hard problem, I lose track of the actual question. Just to prove that I'm not lying, I can share a few more nos with you:
I call what you call maximizing Rn, longest odd streak possible.
First off, all even nos are dismissed.
Secondly, all nos with configuration 4n+1 are also dismissed.
So, you have 4n+3 left.
I wrote down a few of these binomial coefficient that started with 4n+3 and arrived at the condition for the number to not fail to keep up the streak with increasing r's in (4n+3)Cr. I noticed a pattern that I only had to define these criteria for when the r was a power of 2.
For 4n+3=N, say, to fail the streak at 2 k , it must follow this configuration:
N= 2 k + 1 × l + 2 k − 1 . , where l is any +ve integer.
Then I checked whether you asked me to maximize Rn or n, cause I got a larger number when I put k=10. Then I got the maximum value under 10000 to be 6143, but I entered 2048 because I lost track of the question. I also got that for the N=number to fail at 4096, it must be at least 12287 and for 8192, it must at least be 24575.
It's upto you to believe me or not because I saw Chew -Seong Cheong's solution and it was very similar to mine.
EXCELLENT question though.
Log in to reply
@Vishnu C – I just found out why exactly my criteria for continuation for the odd streak were defined at powers of 2:
This is quite lengthy because I've mentioned a lot of obvious steps.
Say we start at 4n+3/1!. This is always going to be odd. Next, we move on to (4n+3)(4n+2)/2! We needn't worry about the previous number, i.e, 4n+3/1 satisfying the odd criterion, because we've already verified that. So, we only need to focus on (4n+2)/2 and we can see that this is also going to be odd. Next, we need to go to ( 3 4 n + 3 ) but now, since we've seen that (4n+3)(4n+2)/2! is odd, we can see that we need to focus on the new numbers:
(4n+1)/3.
This gives you the general pattern that we need to focus on the new numbers. Let's use induction.
If you've seen to it that the criterion for the number PASSING 2 k (in the denominator) is met, i.e, the number that you start with can be expressed as N = 2 k + 1 ( m + 1 ) − 1 , where m = l − 1 , say, is any positive integer.
Now we only need to focus on the new numbers. It's not going to need to be redefined till the next power of 2 because of the following:
N − 2 k − r + 1 = 2 k + 1 l − 2 k − r , for r = 1 . . . 2 k − 1 . We need to focus on the new term 2 k + r 2 k + 1 l − 2 k − r .We only need to worry about even r's because the odd r's cannot make the numerator even, and the denominator is also going to stay odd.
We focus on, for r = 2m, the following:
2 k + 2 m 2 k + 1 l − 2 k − 2 m = 2 k − 1 + m 2 k l − 2 k − 1 − m .
We can see that for odd m, the expression is odd in the numerator and denominator and we can focus on even m, i.e, m=2a. This means r=4a.
Now, again, we can reduce the expression to 2 k − 2 + a 2 k − 1 l − 2 k − 2 − a . It's similar to the previous expression with m. Again, we have to worry about a being even, and so on till r = 2 k − 1 b , where we get:
2 + b 4 l − 2 − b .
Again, this is odd for when b is odd. For when b is even, b=2 and r = 2 k . So now, we have, from our first expression, 2 k + 1 2 k + 1 l − 2 k − 2 k .
We can see that l − 1 = m = even for this to FAIL at 2 k + 1 and l − 1 = m = odd for N to PASS 2 k + 1 . Now we have, m = 2 c + 1 , where c is any positive integer, to make N = 2 k + 1 ( 2 c + 1 + 1 ) − 1 = 2 k + 2 ( c + 1 ) − 1 PASS. For it to fail, we have N = 2 k + 1 ( 2 c + 1 ) − 1 = 2 k + 2 c + 2 k + 1 − 1 .
QED.
Log in to reply
@Vishnu C – Please refrain from typing text in L A T E X
Log in to reply
@Pranjal Jain – I was still abusing it back then. Sorry!
@Pranjal Jain – I fixed it.
@Vishnu C – Please post your solution here! Thanks!
Hey, I just noticed you're in the same district as me! Meet up meet up!
Another Hint: binary expansion
The answer in binary is 1011111111111
For n C r , binomial coefficient to start being even from r= 2 k , the number n should satisfy this equation : 2 k + 1 × l + 2 k − 1 where l, is any +ve integer.
Superb solution!
Problem Loading...
Note Loading...
Set Loading...
The key fact here is Kummer's theorem: the largest power of p dividing ( k n ) is the number of carries when adding k and n − k mod p .
So if the binary expansion of n has a 0 in the 2 r place and a 1 in all the places to the right of that, then R n = 2 r (because there are no binary carries when the digits sum to 1 ). So we need a number for which the rightmost 0 is as far left as possible. This number is 1 0 1 1 1 ⋯ 1 , which is 3 ⋅ 2 r − 1 . For n < 1 0 4 the largest possible r is 1 1 , which gives n = 6 1 4 3 and R n = 2 0 4 8 .
This generalizes for any M : n = 3 ⋅ 2 r − 1 for r chosen as large as possible so that n < M .