0

Trying to prove this via induction. But am kinda stuck. There is a hint for this question that states "Consider the forms of $n$ for which the difference $n-a$ is maximal, and those for which it is minimal.

I have not much idea how this helps me with the question. So far I have computed for some early cases, and indeed the highest power of $2$ lies between $n-1$ and $n-\lfloor \log_2(n+1)\rfloor$, but I don't know why. I think I should know why, but I also don't. I just know that the contribution of various numbers to the power of $2$ is such that even numbers that are not multiples of $4$ contribute $1$ to the power of $2$, multiples of $4$ which are not multiples of $8$ contribute $2$ to the power of $2$, and so on.

So far I have only the base case, and the inductive hypothesis such that the highest power of $2$ that divides $(n-1)!$ lies between $n-2$ and $n-\lfloor \log_2(n)\rfloor$.

If $n$ turns out to be odd, then it would contribute $0$ to the power of $2$. If $n$ is a power of $2$, then it would contribute $\log_2(n)$ to the power of $2$. But I don't see how I can alter the interval from $n-2$ and $n-\lfloor \log_2(n)\rfloor$ to $n-1$ and $n-\lfloor \log_2(n+1)\rfloor$ - I feel so stupid.

By the way, this question is from The Higher Arithmetic by Davenport. And this is not homework - I am just an amateur doing mathematics in his spare time. If someone has full answers for the questions for this textbook, it'd be nice to have a look so I don't have to ask a question whenever I am stuck - but so far the questions seem easy enough though this is the first question I am stuck on.

Edit: this question is in the first chapter, and assumes very little to no knowledge of number theory. I think I am meant to solve this with induction somehow, and not rely on some random theory plucked out of nowhere.

  • 2
  • 1
    Try strong induction. $$a(n)=\lfloor n/2\rfloor +a\left(\lfloor n/2\rfloor\right)$$ – Thomas Andrews Jan 04 '22 at 00:21
  • @user2661923 ah yes Legendre's formula does seem to give an exact answer - now I guess I will have to figure out how to translate that sum into an interval. Hopefully my little brain won't explode. I think between you and Thomas's answer I should be able to figure it out... :/ I'll come back if I don't. – twothreefive Jan 05 '22 at 03:57
  • Ugh I am still stuck. I worked out that from Legendre's formula that if n is a power of 2, then we have a = n -1, which is promising since that is an endpoint of the suggested interval. I really don't understand the hint about n - a. What has the forms of n - a to do with a itself? Can someone please spell it out for me? – twothreefive Jan 05 '22 at 05:50
  • 1
    See the answer that I just posted. – user2661923 Jan 05 '22 at 15:56

3 Answers3

1

If $2^a$ is the highest power of 2 which divides $n!$, show that $a$ lies between $n-1$ and $n-\lfloor \log_2(n+1)\rfloor$.

It is assumed that $n \in \Bbb{Z^+}.$

This answer is a response to the OP's (i.e. original poster's) comment-question, which follows his original posting.

This answer is nothing more than a regurgitation of the following (already posted comments):

  • user2661923 (me) : See Legendre's formula.
  • Thomas Andrews : Try strong induction.
    $a(n) = \lfloor n/2\rfloor + a( ~\lfloor n/2\rfloor ~)$.

Adopting the syntax of the linked Wikipedia article, you have that :

$$v_2(n!) = \sum_{i=1}^\infty \left\lfloor \frac{n}{2^i} \right\rfloor. \tag1 $$

Then, the OP's assertion translates to
To Prove: $(n-1) \geq v_2(n!) \geq n - \lfloor \log_2(n+1) \rfloor.$

The two (bullet pointed) comments above may be used to construct $2$ distinct solutions. I will present both solutions below.




$\underline{\text{Solution 1}}$
In my opinion, the induction approach indicated by the comment of Thomas Andrews provides an elegant solution. Therefore, I will present this solution first.

Let $b = \lfloor n/2\rfloor.$

This solution will need some intermediate results.


The first intermediate result is the one indicated by his comment:

$$\text{To Prove}: ~~v_2(n!) = b + v_2(b!). \tag{IR-1}$$

Proof:

$b = \lfloor (n/2) \rfloor \implies $
$\lfloor b/2 \rfloor = \lfloor (n/4) \rfloor \implies$
$\lfloor b/4 \rfloor = \lfloor (n/8) \rfloor \implies$
$\lfloor b/8 \rfloor = \lfloor (n/16) \rfloor \implies$
$\cdots$

Therefore, using (1) above
$v_2(n!) = \sum_{i=1}^\infty \left\lfloor \frac{n}{2^i} \right\rfloor = b + \sum_{i=2}^\infty \left\lfloor \frac{n}{2^i} \right\rfloor = b + \sum_{i=1}^\infty \left\lfloor \frac{b}{2^i} \right\rfloor = b + v_2(b!).$
This completes the proof of (IR-1) above.


Second intermediate result:

$$\text{To Prove}: ~~n = 2b ~~\text{or} ~~n = 2b + 1. \tag{IR-2}$$

Proof:

$b = \lfloor n/2 \rfloor \implies b \leq n/2 < b + 1 \implies 2b \leq n < 2b+2.$
This completes the proof of (IR-2) above.


Third intermediate result:

$$\text{To Prove}: ~~2b - \lfloor \log_2(b+1) \rfloor \geq n - \lfloor \log_2(n+1) \rfloor. \tag{IR-3}$$

Proof:

IR-3 is immediate for $n=1$. Assume $n > 1$.
Assume that $2^r \leq n < 2^{(r+1)} ~: ~r \in \Bbb{Z^+}.$
IR-3 will be proven by considering the $(3)$ possibilities of
$n = 2^{(r+1)}-1, ~~n = 2^{(r+1)} - 2,~~$ and $~~n < 2^{(r + 1)} - 2~~$ separately.


$n = 2^{(r+1)} - 1 \implies$

  • $\lfloor \log_2(n+1) \rfloor = r + 1$.
  • $b = 2^r - 1 \implies n = 2b + 1$.
  • $\lfloor \log_2(b+1) \rfloor = r$.

$\implies$
$2b - \lfloor \log_2(b+1) \rfloor = (2b - r) = [(2b+1) - (r + 1)] = n - \lfloor \log_2(n+1) \rfloor.$


$n = 2^{(r+1)} - 2 \implies$

  • $\lfloor \log_2(n+1) \rfloor = r$.
  • $b = 2^r - 1 \implies n = 2b$.
  • $\lfloor \log_2(b+1) \rfloor = r$.

$\implies$
$2b - \lfloor \log_2(b+1) \rfloor = (2b - r) = (n - r) = n - \lfloor \log_2(n+1) \rfloor.$


Assuming that $r \geq 2$:
$2^r \leq n < 2^{(r + 1)} - 2 \implies $

  • $\lfloor \log_2(n+1) \rfloor = r$.
  • $2^{(r-1)} \leq b < 2^r - 1$.
  • $\lfloor \log_2(b+1) \rfloor = r-1$.
  • Using (IR-2): $2b+1 \geq n.$

$\implies$
$2b - \lfloor \log_2(b+1) \rfloor = 2b - (r-1) = (2b+1) - r \geq n - r = n - \lfloor \log_2(n+1) \rfloor.$

This completes the proof of (IR-3) above.


The remainder of this solution will use (strong) induction to prove the OP's assertion, via the intermediate results.

Induction - base case: $~n = 1$.
$v_2(1!) = 0~~$ and $~~(1-1) \geq 0 \geq 1 - \lfloor\log_2(1 + 1)\rfloor.$

Induction - strong induction assumption:
Suppose that the assertion holds for each element in $\{1,2,3,\cdots, 2^r - 1\} ~: ~r \in \Bbb{Z^+}.$
Let $n$ be any element in $\{2^r, 2^r + 1, 2^r + 2, \cdots, 2^{(r+1)} - 1 \}.$
This implies that $b < 2^r$.

By the (strong) inductive assumption

$b - 1 \geq v_2(b!) \geq b - \lfloor\log_2(b+1)\rfloor \implies $

$2b - 1 \geq b + v_2(b!) \geq 2b - \lfloor\log_2(b+1)\rfloor \implies $

[Using IR-1]
$2b - 1 \geq v_2(n!) \geq 2b - \lfloor\log_2(b+1)\rfloor \implies $

[Using IR-2 and IR-3]
$n - 1 \geq v_2(n!) \geq n - \lfloor\log_2(n+1)\rfloor.$

Thus:

  • The OP's assertion is true for $n=1$.
  • If the OP's assertion is true for all $n < 2^r ~: r \in \Bbb{Z^+}$,
    then the assertion is also true for all $n$ such that
    $2^r \leq n < 2^{(r+1)}.$

Therefore, the OP's assertion is true for all $n$.




$\underline{\text{Solution 2}}$
This solution is less elegant than the first solution.

Examining (1) above and the corresponding Wikipedia article, it is clear that although the summation goes from $1$ to $\infty$, there are only a finite number of non-zero terms.

Therefore, you have the strict inequality that:

$$v_2(n!) < \sum_{i=1}^\infty \frac{n}{2^i}. \tag2 $$

However, since $\displaystyle \sum_{i=1}^\infty \frac{1}{2^i} = 1$,
(2) above implies that $n > v_2(n!) \implies (n-1) \geq v_2(n!)$,
since $v_2(n!)$ has to be an integer.


For the other part of the inequality in the OP's assertion:

$n=1 \implies v_2(n!) = 0 = 1 - \lfloor \log_2(1+1)\rfloor.$
Therefore, without loss of generality, $n \geq 2.$

Assume that $2^r \leq n < 2^{(r+1)} ~: ~r \in \Bbb{Z^+}.$
The $(2)$ possibilities of
$n = 2^{(r+1)} - 1 ~~$ or $~~2^r \leq n < 2^{(r+1)} - 1$ will be handled separately.


For $n = 2^{(r+1)} - 1$:

$\lfloor \log_2(n+1) \rfloor = r+1.$

$\displaystyle v_2(n!) = \left\lfloor \frac{2^{(r+1)} - 1}{2^1} \right\rfloor + \left\lfloor \frac{2^{(r+1)} - 1}{2^2} \right\rfloor + \left\lfloor \frac{2^{(r+1)} - 1}{2^3} \right\rfloor + \cdots + \left\lfloor \frac{2^{(r+1)} - 1}{2^r} \right\rfloor $

$\displaystyle = \left[2^r - 1\right] + \left[2^{(r-1)} - 1\right] + \left[2^{(r-2)} - 1\right] + \cdots + \left[2^1 - 1\right]$

$\displaystyle = \left[2^r + 2^{(r-1)} + 2^{(r-2)} + \cdots + 2^1\right] - r = \left[2^{(r+1)} - 2\right] - r$

$\displaystyle = \left[2^{(r+1)} - 1\right] - (r+1) = n - \lfloor\log_2(n+1)\rfloor.$


For $2^r \leq n < 2^{(r+1)} - 1$:

$\lfloor \log_2(n+1) \rfloor = r.$

Note that for $i \in \{1,2,\cdots,r\}$

$\displaystyle \frac{n}{2^i} - \left\lfloor \frac{n}{2^i} \right\rfloor \leq \left[1 - \frac{1}{2^i}\right] \implies $

$\displaystyle \left\lfloor \frac{n}{2^i} \right\rfloor \geq \frac{n}{2^i} - 1 + \frac{1}{2^i} = \frac{n+1}{2^i} - 1.$

Also, $\displaystyle \frac{1}{2} + \frac{1}{4} + \cdots + \frac{1}{2^r} = 1 - \frac{1}{2^r}.$

Therefore, with $~~n < 2^{(r+1)},~~$ you have that $~~\displaystyle v_2(n!) = \sum_{i=1}^r \left\lfloor\frac{n}{2^i}\right\rfloor $

$\displaystyle \geq (n+1)\left[1 - \frac{1}{2^r}\right] - r = (n - r) + 1 - \frac{n+1}{2^r}.$

Since it is assumed that $~~2^r \leq n < 2^{(r+1)} - 1,~~$ this implies that

$$v_2(n!) > (n - r) + (1 - 2) = (n - r) - 1.\tag3 $$

So, the LHS of (3) above, which is an integer, is strictly greater than $(n - r) - 1.$ Therefore, the LHS of (3) above must be $\geq (n - r).$

Thus, for $2^r \leq n < 2^{(r+1)} - 1,$
$v_2(n!) \geq (n - r) = n - \lfloor\log_2(n+1)\rfloor.$

Thus, it has been proven that:

  • $(n-1) \geq v_2(n!)$.
  • $v_2(n!) \geq n - \lfloor \log_2(n+1)\rfloor.$
user2661923
  • 35,619
  • 3
  • 17
  • 39
0

One can show, that for some $a = p^n$, that $a!$ is divisible by one $p$ for each instance of (p-1) that divides a.

The arguement is in base p, then $10 \mid 10!$, and in $100!$, there is one instance of $p$ for 100 itself. So $10^{11} \mid 100!$, and so forth. The power of p dividing $n!$ can be broken into the digits of $n$ base p, and removing the sum of digits, leaves a value multiple of p-1, which is the power of $p$ dividing $n!$

For example, in 120!, we see there are 24 multiples of 5, and further 4 multiples of 25, so 120 is 440 base 5. Subtracting (4+4) from 120 gives 112, and dividing this by (5-1) gives 28. Thus $5^{28}\mid 120!$

For 2, the sum of digits is not going to be greater than the logrithm of n+1 against 2, and thus n! will have no more than a power of $\log_2(n+1)$ of 2.

0

Bounds

According to Legendre's Formula (also proven here), the highest power of $2$ that divides $n!$ is $$ \nu_2(n!)=n-\sigma_2(n)\tag1 $$ where $\sigma_2(n)$ is the sum of the digits in the base-2 representation of $n$ (e.g. $\sigma_2(5)=2$).

Since the smallest $n$ with $\sigma_2(n)=k$ is $n=2^k-1$, we get $$ \sigma_2(n)\le\lfloor\log_2(n+1)\rfloor\tag2 $$ For $n\ge1$, $\sigma_2(n)\ge1$. Therefore, we can combine $(1)$ and $(2)$ to get $$ n-\lfloor\log_2(n+1)\rfloor\le\nu_2(n!)\le n-1\tag3 $$


Sharpness

The bounds in $(3)$ cannot be improved since $$ \nu_2(n!)=n-1\qquad\text{for $n=2^k$}\tag4 $$ and $$ \nu_2(n!)=n-k\qquad\text{for $n=2^k-1$}\tag5 $$ and $k=\log_2(n+1)$ in $(5)$.

robjohn
  • 345,667