TITLE: Sequence of $k^2$ and $2k^2$ ordered in ascending order
QUESTION [6 upvotes]: Let $\eta(n)$ be A006337, an "eta-sequence" defined as follows:
$$\eta(n)=\left\lfloor(n+1)\sqrt{2}\right\rfloor-\left\lfloor n\sqrt{2}\right\rfloor$$
Sequence begins
$$1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1$$
Let $a(n)$ be A091524, $a(m)$ is the multiplier of $\sqrt{2}$ in the constant $\alpha(m) = a(m)\sqrt{2} - b(m)$, where $\alpha(m)$ is the value of the constant determined by the binary bits in the recurrence associated with the Graham-Pollak sequence.
Sequence begins
$$1, 1, 2, 2, 3, 4, 3, 5, 4, 6, 7, 5, 8, 6, 9, 7, 10, 11, 8, 12, 9, 13$$
Then we have an integer sequence given by
$$b(n)=(a(n))^2\eta(n)$$
Sequence begins
$$1, 2, 4, 8, 9, 16, 18, 25, 32, 36, 49, 50, 64, 72, 81, 98, 100, 121, 128, 144, 162, 169$$
I conjecture that $b(n)$ is a sequence of $k^2$ and $2k^2$ ordered in ascending order.
Is there a way to prove it?

REPLY [9 votes]: Denote by $f(n)$ the sequence of squares and double squares in ascending order. We have to prove that $f(n)=b(n)=(a(n))^2\eta(n)$. Consider two cases.

$f(n)=k^2$. Then the number of squares  and double squares not exceeding $k^2$ equals $n$, that is, $n=k+\lfloor k/\sqrt{2}\rfloor$. Therefore $n<k(1+1/\sqrt{2})$ that is equivalent (by multiplying to $2-\sqrt{2}$) to $n\sqrt{2}>2n-k$, and $\lfloor n\sqrt{2}\rfloor\geqslant 2n-k$. On the other hand, $n+1>k(1+1/\sqrt{2})$ that analogously yields $(n+1)\sqrt{2}>2(n+1)-k$ and $\lfloor (n+1)\sqrt{2} \rfloor\leqslant 2n-k+1$. Since also $\lfloor (n+1)\sqrt{2} \rfloor\geqslant \lfloor n\sqrt{2} \rfloor+1\geqslant 2n-k+1$, this implies that $\eta(n)=1$. According to OEIS we have $a(n)=a(\lfloor k(1+1/\sqrt{2}\rfloor)=k$, thus $(a(n))^2\eta(n)=k^2$ as needed.


$f(n)=2k^2$. Then the number of squares  and double squares not exceeding $2k^2$ equals $n$, that is, $n=k+\lfloor k\sqrt{2}\rfloor$. So, $n<k(\sqrt{2}+1)<n+1$, and (by multiplying to $\sqrt{2}-1$) we get $n\sqrt{2}<n+k$ and $(n+1)\sqrt{2}>(n+1)+k$. This yields $\eta(n)=2$. Again by OEIS we get $a(n)=a(\lfloor k(1+\sqrt{2}\rfloor)=k$ and $(a(n))^2\eta(n)=2k^2$.