Preamble: We will construct a function $g$ such that there is no bijection $f$ that satisfies $|f(n+1) - f(n) | = g(n)$. The idea is:
- If $f(n) < g(n)$, then we must have $f(n+1) = f(n) + g(n)$, so we can force $f(n)$ to increase significantly.
- For $g(n)$ to be a bijection, it needs to cover the small values.
- If $g(n)$ is alternating large and small, then perhaps we can force $f(n)$ to grow quickly, and hence cannot cover the small values.
As a numerical example,
If $f(1) = 10$ and $g(1) = 1,000$, then we must have $f(2) = f(1) + g(1) = 1010$.
If $g(2) < 10$, then $f(3) \leq f(2) + g(2) = 1020$.
If $g(3) > 1020$, then we must have $f(4) = f(3) + g(3) > 1020$.
If we can show that for $n > 4$, $f(n) > 1020$, then $f$ will not be a bijection.
The linked question avoids this structure because the values of $g(n)$ are close to each other.
Solution: We essentially fill in the details of the idea / numerical example and verify the inequalities that we need.
Define $g(n)$ in the following way:
- For $ n = 2k-1$, $g(n) = 4^k$
- For $n = 2k $, $g(n)$ is the smallest positive integer that hasn't been attained by $g(i), i < n$.
- This ensures $g$ is a bijection.
- Trivially $g(n) \leq n$ for these values. That is all that we need.
Let $f$ be any function (not necessarily a bijection) such that $|f(n+1) - f(n) | = g(n)$.
Observation: For $n = 2k-1$ and $k \geq 2$, $ \sum_{i < n} g(i) < \frac{2}{5} g(n)$.
Proof: We split the sum for the odd and even terms.
$\sum_{i =1}^{k-1} g(2i-1) \leq \frac{4^{k-1} } { 1 - \frac{1}{4}} = \frac{ 4^k } { 5} $ as the sum of a geometric progression.
$ \sum_{i =1 }^k g(2i) \leq 2 \sum i = \frac{k(k+1) } { 2} < \frac{4^k}{5} $ as an arithmetic progression sum.
Thus $\sum_{i < n} g(i) < 4^k \times \frac{2}{5} $.
Observation: No matter what value $f(1)$ takes, there exists a $K$ such that for all $k > K$, $f(2k) - f(2k-1) = g(2k-1)$.
Proof: Take $ K = \lfloor \log_{4} 5 f(1) \rfloor +2 \geq 2$, so $5f(1) < 4^K$.
For any $k \geq K$, $f(2k-1) \leq f(1) + \sum_{i < 2k-1} g(i) < \frac{1}{5} 4^K + \frac{ 2}{5} 4^k < 4^k = g(2k-1) $.
Hence $f(2k) - f(2k-1) = g(2k-1)$.
Corollary: For $k > K$, $f(2k) > g(2k-1) \geq 4^k > 4^K$.
Corollary: For $n = 2k+1$ and $k > K$, $$f(2k+1) \geq f(2k) - g(2k) \geq f(2k) - 2k > 4^{k} - 2k \geq 4^K.$$
Corollary: Since $f(n) < 4^K $ implies that $n \leq 2K+1 $, hence there aren't enough values for the range of $f$ to contain all of the integers up to $4^K$, thus $f$ is not a bijection.