3

Building on this post, we conclude that the Gould's sequence A001316 is formulated as follows:

$$G(n)=\frac{2^n}{gcd(2^n,n!)}=2^{H(n)}$$

Where $H(n)$ is the Hamming weight of a number $n\in\mathbb{N}$. Therefore, it can be expressed as:

$$H(n)=\log_2\left(G(n)\right)=\log_2\left(\frac{2^n}{gcd(2^n,n!)}\right)$$

Or, alternatively, given that the amount of 2 factors in $n!$ is produced by the Legendre's formula, it can be rewritten as:

$$H(n)=\log_2\left(\frac{2^n}{\displaystyle\sum _{k=1}^{\left\lfloor \log _2(n)\right\rfloor } \left\lfloor \frac{n}{2^k}\right\rfloor}\right)$$

However, I didn't find any proof for the first formulation of $H(n)$, so I would like to know how can it be proven the equivalence between the Hamming weight of a positive integer $n$ and the base-2 logarithm of the ratio between $2^n$ and its greatest common divisor with $n!$, which is given by the Legendre's $v_2(n!)$.

Bill Dubuque
  • 282,220
Cardstdani
  • 193
  • 13

1 Answers1

4

Based on the discussion in the comments (or by the answer from the cited post), it is left to prove that $2^{v_2(n!)} = \gcd(2^n, n!)$. Write $n! = 2^{v_2(n!)}\cdot m$ where $m$ is an odd integer, so we get that $\gcd(2^n, n!) = 2^{\min(n, v_2(n!))}$. It is left to prove that $n\geq v_2(n!)$. This indeed hold by Legendre's formula $$v_2(n!) = \sum_{i=1}^{\infty} \left\lfloor \frac{n}{2^i}\right\rfloor \leq n\cdot \sum_{i=1}^{\infty} \frac{1}{2^i} =n $$

  • Can you expand on the step where you write the factorial as the product with an odd integer? – Cardstdani Sep 25 '24 at 16:41
  • 1
    @Cardstdani Sure - In general, the $p$-adic valuation of an integer $d$, $v_p(d)$, where $p$ is a prime number, is the natural number $r$ such that $p^r \mid d$ while $p^{r+1} \not \mid d$. In other words, one can write $d = p^{v_p(d)} \cdot m $ where $\gcd(m, p) = 1$. For the case where $p=2$, you get what I wrote. – Omer Simhi Sep 25 '24 at 16:47
  • @Cardstdani is the answer clearer to you now, after the comment? – Omer Simhi Sep 28 '24 at 14:56