Let $n,k\in\mathbb N$, and $n\ge 2,k\ge 0$.
Let $a_k(n)$ be the largest number that has $k$ less digits in number base $n+1$ than in base $n$.
Let $b_k(n)$ be the smallest number that has $k$ less digits in number base $n+1$ than in base $n$.
Question. How can we find closed forms (calculate efficiently) for these two sequences?
That is, a number $m\in\mathbb N$ has $\lfloor\log_nm\rfloor+1$ digits in number base $n$. This lead me to the following two identities, for the above two sequences:
$$a_k(n)=\max\{m\in\mathbb N:\lfloor\log_nm\rfloor-\lfloor\log_{n+1}m\rfloor=k\}$$
$$b_k(n)=\min\{m\in\mathbb N:\lfloor\log_nm\rfloor-\lfloor\log_{n+1}m\rfloor=k\}$$
After computing some values for these, it looks like the following holds:
$$\log_n(a_k(n)+1)=\left\lfloor\frac{(k+1)\log(n+1)}{\log(n+1)-\log(n)}\right\rfloor$$
$$\log_n(b_k(n))=1+\left\lfloor\frac{(k-1)\log(n+1)}{\log(n+1)-\log(n)}\right\rfloor$$
Where for second identity, for $k=0$, we take $b_0(n)=1$ instead, specially.
Question. How can we prove these two identities?
Remark.
For $k=0$, the following OEIS sequence seems relevant: A031435, where we take $a_0(1)=1$.
Can we prove $\log_n(1+a_0(n))$ is equivalent to the linked OEIS sequence?