3
$\begingroup$

In a meanwhile deleted question I had mentioned my observation, that $$H\left(2^m-1\right) = H\left(3*(2^m-1)\right) = H\left(3*(2^m-1)\ +\ 1\right)$$ where $H()$ denotes the Hamming weight.

Question:

are there other examples of combinations of a set $\Sigma\subset\mathbb{N}$ with a function $f: \mathbb{N}\ni i\mapsto j\in\mathbb{N} $ with the following properties:

  • the elements of $\Sigma$ can be generated from the elements of $\mathbb{N}$ via a finite sequence of arithmetic integer operations.

  • $f$ can be evaluated with fixed, finite sequence of arithmetic integer operations and doesn't amount to a mere shift operation, i.e. $f(n)\ne 2^kn$

  • $H\left(\sigma\in\Sigma\right) = H\left(f(\sigma)\right)$

in the original observation $\Sigma:=\lbrace 2^{i+1}-1|i\in\mathbb{N}\rbrace$ and $f:=3k\ $ resp., $\ f:=3k+1$

$\endgroup$
2
  • $\begingroup$ remark: I used the "coding-theory" label because I'm not aware of more appropriate ones; please feel free to replace with better ones. $\endgroup$ Commented May 27, 2017 at 7:08
  • $\begingroup$ You can probably cook up similar things by constructing $\Sigma$ to have numbers with runs of 1s at carefully designed places. I recall seeing quite a few patterns when playing with this Math.SE question. There the focus was different from yours, but it wouldn't surprise me if $f(x)=x^2$ would work for a carefully selected $\Sigma$. $\endgroup$ Commented May 28, 2017 at 5:11

1 Answer 1

3
$\begingroup$

The following sequences work as $\Sigma$ for $f(x)=x^2$

  • $x_n=2^n-1$ has Hamming weight $n$ as does $x_n^2=2^{2n}-2^{n+1}+1$ (the number $2^{2n}-2^{n+1}$ has a run of $n-1$ ones followed by $n+1$ zeros in binary).
  • Slightly more complicated is $x_n=2^n+2^{n-2}-1$. Here $H(x_n)=n-1$ and $$x_n^2=2^{2n}+2^{n-1}\left(2^n+2^{n-3}-8+3\right)+1.$$ For $n\ge6$ the number in parens has runs of ones of lengths $1$, $n-6$ and $2$, so $H(x_n^2)=n-1$.

The same sequences also work for $f(x)=5x$

  • $x_n=2^n-1$. Here $H(x_n)=n$ and $f(x_n)=2^{n+2}+2^n-2^3+3$ also has Hamming weight $n$ when $n\ge3$.
  • $x_n=2^n+2^{n-2}-1=5\cdot2^{n-2}-1$ has Hamming weight $n-1$ as does $$5x_n=2^{n+2}+2^{n+1}+2^{n-2}-8+3$$ whenever $n\ge5$.

Probably it is not too difficult to cook up other such sequences. Those were the ones I could easily spot from numerical data.

$\endgroup$
2
  • $\begingroup$ It is probably easy to find more examples. I have minor reservations about this question being at research level, but I am not really too acquainted with the current culture of MO. $\endgroup$ Commented May 28, 2017 at 6:23
  • 1
    $\begingroup$ I agree that the "research level" criterion is hard to judge; its probably a similiar thing as telling what "art" is. As I see it, a lot of upvoted questions are related to noticing something surprising. My question may not have been too hard to answer, but it may also have drawn attention to the trichotomy of the Hamming weight of integer functions: is there a bias towards increased weights or towards decreased weights or, are there "situations" where behavior is "balanced"? It is hard to tell whether this will lead to questions that are truly research level. $\endgroup$ Commented May 28, 2017 at 14:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .