Thursday, 25 April 2013

elementary number theory - Why does lfloorfracnxrfloor have at most 2sqrtn values when x=1,2,dotsn?



The question is very short and clear:



Why does nx (floor of nx) have at most 2n values when x=1,2,,n?



I saw this statement at tutorial of 449A at codeforces, I really want to know how we get that, and since the amount of values should be integer, why 2n?



And I don't know the specific category of this problem so I just tag it as elementary number theory.


Answer




Over the range 1xn, x can take on only n distinct integer values. Thus, nx can only take on n distinct values, one for each distinct value of x.



Over the range nxn, we have that 1nxn. Thus, nx can only take on n distinct values, one for each integer between 1 and n.



This adds up to 2n values over the entire range 1xn.



Note that this is an upper bound and not an exact number. For instance, if n=6, then we have at most 264.89 values. Indeed, 61=6, 62=3, 63=2, 64=65=66=1, so we have 4 distinct values.


No comments:

Post a Comment

real analysis - How to find limhrightarrow0fracsin(ha)h

How to find limh0sin(ha)h without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...