\documentclass[12pt,reqno]{article}

\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amscd}
\usepackage{graphicx}

\usepackage[colorlinks=true,
linkcolor=webgreen,
filecolor=webbrown,
citecolor=webgreen]{hyperref}

\definecolor{webgreen}{rgb}{0,.5,0}
\definecolor{webbrown}{rgb}{.6,0,0}

\usepackage{color}
\usepackage{fullpage}
\usepackage{float}

\usepackage{psfig}
\usepackage{graphics}
\usepackage{latexsym}
\usepackage{epsf}
\usepackage{breakurl}

\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{.1in}
\setlength{\evensidemargin}{.1in}
\setlength{\topmargin}{-.1in}
\setlength{\textheight}{8.4in}

\newcommand{\seqnum}[1]{\href{https://oeis.org/#1}{\rm \underline{#1}}}

\begin{document}

\begin{center}
\epsfxsize=4in
\leavevmode\epsffile{logo129.eps}
\end{center}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{conjecture}[theorem]{Conjecture}

\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{question}[theorem]{Question}

\begin{center}
\vskip 1cm{\LARGE\bf 
Palindromes and Antipalindromes\\
\vskip .1in
 in Short Intervals 
}
\vskip 1cm
\large
Prapanpong Pongsriiam\footnote{Prapanpong Pongsriiam is the corresponding author.}\\

Department of Mathematics\\ Faculty of Science \\
Silpakorn University\\ Nakhon Pathom	73000\\ Thailand\\
\href{mailto: prapanpong@gmail.com}{\tt prapanpong@gmail.com}\\
\href{mailto: pongsriiam\_p@silpakorn.edu}{\tt pongsriiam\_p@silpakorn.edu}\\
\ \\

Kota Saito\\
Faculty of Pure and Applied Sciences\\ University of Tsukuba\\ 1-1-1 Tennodai, Tsukuba\\ Ibaraki, 305-8577\\ Japan \\
\href{mailto: saito.kota.gn@u.tsukuba.ac.jp}{\tt saito.kota.gn@u.tsukuba.ac.jp}

\end{center}

\vskip .2 in


\begin{abstract}
For each positive integer $b$ larger than $1$, we obtain the shortest intervals that always contain a $b$-adic palindrome and a $b$-adic antipalindrome. We also give some results on the classification of $b$-adic twin palindromes, gaps that occur infinitely often between $b$-adic palindromes, and the irrationality of the sum of reciprocals of a particular type of $b$-adic palindrome.
\end{abstract}


\section{Introduction}

Let $b$ and $n$ be integers, $b \geq 2$, and $n\geq 1$, and let $n = (n_kn_{k-1}\cdots n_0)_b$ be the $b$-adic expansion of $n$ with $n_k\neq 0$. We call $n$ a \textit{palindrome in base $b$ (or $b$-adic palindrome)} if $n_{k-i}=n_i$ for $0\leq i \leq \left\lfloor k/2\right\rfloor$. As usual, if we write a number without specifying the base, then it is always in base 10, and if we write $n = (n_k n_{k-1} \cdots n_0)_b$, then it means that $n = \sum_{i = 0}^k n_i b^{i}$, $n_k \neq 0$, and $0 \leq n_i < b$ for all $i = 0,1,\ldots,k$. The sequence of $10$-adic palindromes and the sequence of palindromic primes in base $10$ are given, respectively, as \seqnum{A002113} and \seqnum{A002385} in the \textit{On-Line Encyclopedia of Integer Sequences} (OEIS) \cite{Slo}. In addition, we write $\left\lfloor x\right\rfloor$ for the greatest integer less than or equal to $x$ and $\left\lceil x\right\rceil$ for the least integer larger than or equal to $x$. It seems that there is more than one intuitive definition for antipalindromic structure, so we will try to cover more than one, too. Suppose that $n$ is a \textit{$b$-adic antipalindrome} of a particular type, to be defined below. We say that 
\begin{align*}
&\text{$n$ is of \textit{type 0 (or no middle type)} if $k$ is odd and $n_{k-i}+n_i = b-1$ for $0\leq i \leq \left\lfloor k/2\right\rfloor$};\\
&\text{$n$ is of \textit{type 1 (or one middle type)} if $n_{k-i}+n_i = b-1$ for $0\leq i \leq \left\lfloor k/2\right\rfloor$};\\
&\text{$n$ is of \textit{type 2 (or free middle type)} if $n_{k-i}+n_i = b-1$ for $0\leq i \leq \left\lfloor (k-1)/2\right\rfloor$};\\
&\text{$n$ is of \textit{type 3 (or asymmetric type)} if $n_{k-i}\neq n_i$ for $0\leq i \leq \left\lfloor (k-1)/2\right\rfloor$}.
\end{align*}
If $1\leq n< b$, then $k=0$ and $n$ is defined to be a $b$-adic antipalindrome of types 2 and 3. When $k$ is odd, types 0, 1, and 2 are the same; when $k$ is even, they are different, as it is necessary that $b$ is odd and $2n_{\frac k2} = b-1$ for type 1 (one middle type), but there is no restriction on $b$ and $n_{\frac k2}$ for type 2 (free middle type). We remark that types 0 and 1 appear in the work of Bai, Meleshko, Riasat, and Shallit \cite{BMRS} and Dvo\v r\'akov\'a, Kruml, and Ryzak \cite{DKR}. Type 3 (asymmetric type) is modified from the
notion of antipalindromic composition in the article by Andrews, Just, and Simay \cite{AJS}, and a generalization by Huang \cite{Hua}. Type 2 uses the equality $n_{k-i}+n_i = b-1$ as in types 0 and 1, and the index condition $i \leq \left\lfloor (k-1)/2\right\rfloor$ as in type 3. The sequence of binary antipalindromes of type 0 is given as  \seqnum{A035928} in OEIS \cite{Slo}.
	
The interval $\left(n^2,(n+1)^2\right]$ obviously contains a square, and Legendre conjectured that it also contains a prime for all large $n \in \mathbb N$, but this is still open. Replacing the existence or nonexistence of primes and squares in the interval such as $\left(n^2,(n+1)^2\right]$ by that of $b$-adic palindromes and $b$-adic antipalindromes leads to an easier problem than
that of the primes, but less obvious and more interesting than that of squares. We should remark here that the analogy between primes and palindromes is artificial; we mention it merely for the form of questions being asked. Nevertheless, by Phunphayap and Pongsriiam's results \cite[Theorems 9--10]{refpalin2}, we see that if  $A_b(x)$ and $s(x)$ are, respectively, the number of $b$-adic palindromes and squares less than or equal to $x$, then $A_b(x)\asymp s(x)$. Here, if $f(x)$ and $g(x)$ are positive for all large $x$, then we write $f(x)\asymp g(x)$ to mean that there are constants $c_1, c_2>0$ such that $c_2g(x)\leq f(x)\leq c_1g(x)$ for all large $x$. This motivates us to compare or find a connection between squares and palindromes. Based on his recent work \cite{refpalin1, refpalin2, refpalin3, refpalin4}, Pongsriiam gave a talk on races between palindromes in different bases in a conference
%\footnote{There is no official English name for this conference, but it is a conference on any branch of mathematics related to algebra, number theory, and algebraic geometry.}
on algebra for young researchers, which led to the writing of this article. We obtain the intervals having minimal length that always contain a $b$-adic palindrome and a $b$-adic antipalindrome, respectively. The reader will see that the forms of some answers are connected to squares or square roots and look like analogs of Legendre's conjecture on primes in short intervals; see for example in Corollaries \ref{cor3(n,n+csqrtn-1}, \ref{cor17c2sqrtb}, and \ref{cor21fromcor19}.

\section{Main results}
We split our main results into four subsections: (i) palindromes in short intervals, (ii) twin palindromes and fixed gaps between palindromes, (iii) antipalindromes of types 0, 1, and 2, and (iv) antipalindromes of type 3. We begin with palindromes as follows.

\subsection{Palindromes in short intervals}
\begin{theorem}\label{thm1}
Let $b$ be an integer not less than $2$. Let $c = \sqrt{b}+\sqrt{b^{-1}}$ and $(x_n)$ the strictly increasing sequence of all $b$-adic palindromes. Then 
$$
x_{n+1}-x_n\leq c\sqrt{x_n-1}\quad\text{for all $n\geq 2$,}
$$
and the inequality is sharp in the sense that there are infinitely many $n\in \mathbb N$ such that
\begin{equation}\label{eq1}
x_{n+1}-x_n = c\sqrt{x_n-1}.
\end{equation}
In fact, we obtain that \eqref{eq1} holds whenever $x_n = b^k+1$, $k\geq 3$, and $k$ is odd.
\end{theorem}
\begin{proof}
Let $n = (n_kn_{k-1}\cdots n_1n_0)_b$ be a $b$-adic palindrome with $n\geq 2$ and $n_k\neq 0$, and let $m$ be the smallest $b$-adic palindrome larger than $n$. If $2\leq n < b-1$, then $m=n+1$, and so $m-n = 1\leq c\sqrt{n-1}$. If $n = b-1$, then $b\geq 3$ and $m = n+2$, and so $m-n = 2\leq c\sqrt{n-1}$. If $b\leq n \leq b^2$, then $m = n+\ell$ where $\ell = 2$ or $\ell=b+1$, and thus $m-n\leq b+1=c\sqrt b \leq c\sqrt{n-1}$. So assume throughout that $n>b^2$. Then $k\geq 2$. If $n = b^{k+1}-1$, then $m-n= 2\leq c\sqrt{n-1}$. So assume that $n\neq b^{k+1}-1$. Then  $n_i\neq b-1$ for some $i = 0,1,2,\ldots,k$. 

\bigskip\noindent
\textbf{Case 1:} $k$ is odd and $n_{\frac{k+1}{2}}\neq b-1$. Let $y = b^{\frac{k+1}{2}}+b^{\frac{k-1}{2}}$. Then $n+y$ is a $b$-adic palindrome, and so $m\leq n+y$. This and $n\geq b^k+1$ imply that 
$$
\frac{m-n}{\sqrt{n-1}}\leq \frac{y}{\sqrt{n-1}} \leq \frac{b^{\frac{k+1}{2}}+b^{\frac{k-1}{2}}}{b^{\frac k2}} = c.
$$

\bigskip\noindent
\textbf{Case 2:} $k$ is even and $n_{\frac k2}\neq b-1$. Similar to Case 1, we obtain $m\leq n+b^{\frac k2}$, and so $(m-n)/\sqrt{n-1}\leq 1\leq c$.

\bigskip\noindent
\textbf{Case 3:} $k$ is odd and $n_{\frac{k+1}{2}} = b-1$.  Let $i$ be the largest integer such that $0\leq i <\frac{k-1}{2}$  and $n_i\neq b-1$. Let $y = b^{i+1}+b^i$. Then $n+y$ is a $b$-adic palindrome, and so
$$
\frac{m-n}{\sqrt{n-1}}\leq \frac{y}{\sqrt{n-1}} \leq \frac{b^{\frac{k-1}{2}}+b^{\frac{k-3}{2}}}{b^{\frac k2}} = \frac{1}{\sqrt b}+\frac{1}{b\sqrt b}\leq c.
$$

\bigskip\noindent
\textbf{Case 4:} $k$ is even and $n_{\frac k2} = b-1$. Let $i$ be the largest integer such that $0\leq i <\frac k2$  and $n_i\neq b-1$.  Similar to Case 3, we obtain $m\leq n+b^{i+1}+b^i$ and 
$$
\frac{m-n}{\sqrt{n-1}} \leq 1+\frac{1}{b} \leq c.
$$
In any case, we obtain $m-n \leq c\sqrt{n-1}$, which proves the first part of this theorem. Next, if $n=b^k+1$ where $k$ is an odd integer not less than $3$, then $m = n+b^{\frac{k+1}{2}}+b^{\frac{k-1}{2}}$,  and therefore
$$
m-n = cb^{\frac k2} = c\sqrt{n-1}.
$$ 
This proves the second part. So the proof is complete.
\end{proof}
\begin{corollary}\label{limitsupinfcor2}
Let $b$ be an integer not less than $2$ and let $(x_n)$ be the strictly increasing sequence of $b$-adic palindromes. Then
$$
\limsup_{n\to\infty}\frac{x_{n+1}-x_n}{\sqrt{x_n}} = \sqrt b+\frac{1}{\sqrt b}\quad\text{and}\quad \liminf_{n\to\infty}(x_{n+1}-x_n) = 2.
$$
\end{corollary}
\begin{proof}
The limit supremum follows immediately from Theorem \ref{thm1}. For the limit infimum, suppose $y$ is the nonzero leading digit of $x_n$, and $y_0$ is the last digit of $x_n$ in the $b$-adic expansion of $x_n$, where $x_n\geq b$. If $y_0\neq b-1$, then the last digit of $x_n+1$ is $y_0+1\neq y$, so $x_n+1$ is not a $b$-adic palindrome. If $y_0 = b-1$, then the last digit of $x_n+1$ is zero, so $x_n+1$ cannot be a $b$-adic palindrome. This shows that if $x_n\geq b$, then $x_{n+1}\geq x_n+2$. In addition, if $x_n = b^k-1$ where $k$ is a positive integer, then $x_{n+1} = x_n+2$. So the limit infimum above is $2$. 
\end{proof}
\begin{corollary}\label{cor3(n,n+csqrtn-1}
Let $b$ be an integer not less than $2$ and let $c = \sqrt b+\sqrt{b^{-1}}$. Then for each integer $n\geq 2$, there exists a $b$-adic palindrome in the interval 
$$
\left(n,n+c\sqrt{n-1}\right].
$$
Furthermore, the interval is best possible in the sense that there are infinitely many $n$ such that the open interval $\left(n,n+c\sqrt{n-1}\right)$ does not contain a $b$-adic palindrome.
\end{corollary}
\begin{proof}
Let $n\geq 2$ and $A = (n,n+c\sqrt{n-1}]$. If $n$ is a $b$-adic palindrome, then the result follows immediately from Theorem \ref{thm1}. Suppose $n$ is not a $b$-adic palindrome. Then we have 
$$
\text{$x_m<n<x_{m+1}$ where $x_m$ and $x_{m+1}$ are consecutive $b$-adic palindromes.}
$$
Then $x_{m+1}>n$ and $x_{m+1}\leq x_m+c\sqrt{x_m-1}<n+c\sqrt{n-1}$. So $x_{m+1}\in A$. If $n = b^k+1$ and $k$ is an odd integer not less than $3$, then Theorem \ref{thm1} implies that the open interval $(n,n+c\sqrt{n-1})$ does not contain a $b$-adic palindrome.
\end{proof}
The limit infimum in Corollary \ref{limitsupinfcor2} leads us to the study of twin palindromes. If $m>n$, then we say that $m$ and $n$ are $b$-adic twin palindromes if $m$ and $n$ are $b$-adic palindromes and $m=n+2$. In the next subsection, we determine all $b$-adic twin palindromes and give some related results.

\subsection{Twin palindromes and fixed gaps between palindromes}

\begin{theorem}\label{thm-twin2adic}
{\rm (Classification of all $2$-adic twin palindromes)} Let $n$ be a $2$-adic palindrome. Then $n+2$ is a $2$-adic palindrome if and only if $n = 2^{k+1}-1$ for some integer $k\geq 0$, or $n=(101)_2$.
\end{theorem}

\begin{proof}
It is clear that if $n = (101)_2$ or $n = 2^{k+1}-1$ for some integer $k\geq 0$, then $n+2$ is a $2$-adic palindrome. Next, assume that $m=n+2$ is a $2$-adic palindrome. Let $n=(n_kn_{k-1}\cdots n_1 n_0)_b$ and $m= (m_\ell m_{\ell-1} \cdots m_1 m_0)_b$ where $k\geq 0$. 

For $0\leq k\leq 2$, we see that the $2$-adic palindromes having at most $3$ digits are $(1)_2 = 2-1$, $(11)_2 = 2^2-1$, $(101)_2$, and $(111)_2 = 2^3-1$, which are either $(101)_2$ or of the form $2^{k+1}-1$ for some integer $k\geq 0$. So we assume that  $k\geq 3$. 

If $n_1=0$, then we have $k=\ell$, $m_1 = 1$, $n_i=m_i $ for all $i\neq 1$, and so $1=m_1=m_{k-1}=n_{k-1}=n_1=0$, a contradiction. Therefore $n_i=1$ for all $i\leq 1$. Let $j$ be the largest integer less than or equal to $\lfloor k/2\rfloor $ such that $n_i=1$ for all $i\leq j$. Suppose that $j<\lfloor k/2\rfloor$. Then $n_{j+1}=0$. Therefore $m_{j+1}=1$, $n_i = m_i$ for all $i>j+1$, and $m_i = 0$ for all $1\leq i\leq j$. Then $0=m_{1}=m_{k-1}=n_{k-1}=n_{1}=1$, a contradiction. Therefore $j=\lfloor k/2\rfloor$. Then $n_i = 1$ for all $i$. Thus $n=2^{k+1}-1$. 
\end{proof}

\begin{theorem}\label{thm-twinbadic}
{\rm (Classification of all $b$-adic twin palindromes)} Let $b$ be an integer not less than $3$ and let $n$ be a $b$-adic palindrome not less than $b$. Then $n+2$ is a $b$-adic palindrome if and only if $n = b^{k+1}-1$ for some integer $k\geq 0$.
\end{theorem}
\begin{proof}
It is clear that $b^{k+1}+1$ and $b^{k+1}-1$ are $b$-adic twin  palindromes for every integer $k\geq 0$. Next, let $m$ and $n$ be $b$-adic twin palindromes and $m>n\geq b$. Let $n=(n_kn_{k-1}\cdots n_1 n_0)_b$ and $m= (m_\ell m_{\ell-1} \cdots m_1 m_0)_b$, where $k\geq 1$. 

If $n_0\leq b-3$, then $k=\ell$, $n_i=m_i $ for all $1\leq i\leq k$, and $m_0=n_0+2$. By the fact that $n_k=n_0$, $n_k=m_k$, and $m_k=m_0$, we have
\[
m_0=n_0+2=n_k+2=m_k+2=m_0+2,
\]
which is not possible. If $n_0 = b-2$, then $m_\ell=m_0=0$, which is false. Therefore $n_0=b-1$, and so $m_\ell=m_0=1$. 


If $\ell=k$, then $0<n_k\leq m_\ell = 1 $. Thus $1=n_k=n_0=b-1$, which is a contradiction. Thus we obtain $\ell=k+1$ and $m_{k+1}=m_0=1$. Therefore $n+2 = m \geq b^{k+1}+1$, and so $b^{k+1}>n\geq b^{k+1}-1$. Hence $n= b^{k+1}-1$.  
\end{proof}

It is known that the sum of reciprocals of all twin primes converges, that is, 
\begin{equation}\label{Burnsconstant}
\sum_{\substack{\text{$p$ and $p+2$ are}\\ \text{prime numbers}}} \left(\frac{1}{p}+\frac{1}{p+2}\right)
\end{equation}
converges. This result was given by Brun \cite{Brun}, and the constant \eqref{Burnsconstant} is called Brun's constant. It is unknown whether Brun's constant is irrational or rational. If we obtained the irrationality of the constant, then we would conclude the infinitude of twin primes. We remark again that the 
mention of primes is only for the visual form of questions being asked.  Instead of twin primes, we investigate the irrationality of the sum of reciprocals of all twin $b$-adic palindromes as follows: 
\begin{theorem}\label{thm-brun}
For each integer $b\geq 2$, the sum of reciprocals of all $b$-adic twin palindromes converges to an irrational number, that is, 
\begin{equation}\label{Series-BurnPalindrome}
\sum_{\substack{\text{\rm $m$ and $n$ are $b$-adic} \\\text{\rm twin palindromes}\\\text{\rm and $m>n$}} } \left(\frac{1}{n} +\frac{1}{m} \right) \notin \mathbb{Q}.
\end{equation}
\end{theorem}

\begin{proof} Fix $b\geq 2$. By Theorems \ref{thm-twin2adic} and \ref{thm-twinbadic}, it suffices to show that 
\begin{equation}\label{Series-Lambert}
\sum_{k=1}^\infty  \left(\frac{1}{b^k-1} +\frac{1}{b^k+1} \right) = 2\sum_{k=1}^\infty\frac{b^k}{b^{2k} -1} 
\end{equation}
is irrational. Define $L(z)=\sum_{k=1}^\infty z^k/(b^{2k}-1)$ on $|z|< b^2$. Then we see that
\[
L(z)-L\left(z/b^2\right) = \sum_{k=1}^\infty  \frac{z^k - (z/b^2)^k}{b^{2k}-1} =  \sum_{k=1}^\infty \left(\frac{z}{b^2} \right)^k= \frac{z}{b^2-z}. 
\]
Therefore we have
\begin{align*}
L(z)&=\frac{z}{b^2-z} + L(z/b^2) \\
&= \frac{z}{b^2-z} + \frac{z}{b^4-z} +L(z/b^4)\\
&=\cdots = \sum_{k=1}^N \frac{z}{b^{2k}-z} + L(z/b^{2N}). 
\end{align*}
Since $\lim_{N\to \infty} L(z/b^{2N})=0$, we obtain $L(z)= \sum_{k=1}^\infty z/(b^{2k}-z)$. Substituting $z=b$ in $L(z)$, we see that the right-hand side of \eqref{Series-Lambert} is equal to $2 \sum_{k=1}^\infty  b/(b^{2k}-b)$. By Borwein's result \cite[Theorem 1]{Borwein}, the sum $\sum_{k=1}^\infty 1/(b^{2k}-b)$ is irrational. Therefore \eqref{Series-Lambert} is irrational.
\end{proof}

The irrationality of \eqref{Series-Lambert} is a direct consequence of Borwein's result. Recall that the function 
$$
L_q(z) = \sum_{k=1}^\infty \frac{z^k}{q^k-1} = \sum_{k=1}^\infty \frac{z}{q^k-z}
$$
is called the $q$-logarithmic function. The irrationality and $\mathbb{Q}$-linear independence of the special values of $L_q(z)$ are well-studied. For example, by Tachiya's result \cite[Example 1]{Tachiya}, the following three numbers
\[
1,\quad  L_q(1) = \sum_{k=1}^\infty \frac{1}{q^k-1},\quad L_q(-1) = -\sum_{k=1}^\infty \frac{1}{q^k+1} 
\]
are linearly independent over $\mathbb{Q}$, which also immediately implies the irrationality of \eqref{Series-Lambert}.  We will use $L_q(z)$ again in Conjecture \ref{conj-qlogarithm} and Theorem \ref{thm-gentwin3}. 

We next investigate a more general setting. For all integers $b\geq 2$ and $d \geq 1$,  we define 
\begin{align}
R(b;d)&=\{ (n,m)\in \mathbb{N}^2 \mid \text{ $m$ and $n$ are $b$-adic palindromes, and $m-n=d$} \},\label{Req}\\
C(b;d)&= \sum_{(n,m)\in R(b;d)} \left(\frac{1}{n}+\frac{1}{m}\right). \notag 
\end{align}
In view of the case $d=2$, we expect the irrationality of $C(b;d)$ for some other values of $d\geq 3$ too. Nevertheless, not all $C(b;d)$ are irrational. For instance, if $R(b;d)$ is a finite set, then $C(b;d)$ is rational. So we will first determine all values of $d$ such that $R(b;d)$ is an infinite set. Secondly, we describe all except a finite number of elements of $R(b;d)$ when $R(b;d)$ is infinite. After that we prove the irrationality of $C(b;d)$ for all $b$ and $d$ such that $R(b;d)$ is infinite by assuming Bundschuh and V\"{a}\"{a}n\"{a}nen's conjecture \cite{BV}.

Before stating the conjecture, we define $K^* = K\setminus \{0\}$ to be the set of all nonzero elements of a field $K$, and $q^A= \{q^a \mid a\in A \}$ for every $A\subseteq \mathbb{R}$. We also write $L_q^{(n)}(z)$ for the $n$th derivative of $L_q(z)$. Then  Bundschuh and V\"{a}\"{a}n\"{a}nen's conjecture is as follows.

\begin{conjecture}[{\cite[Conjecture]{BV}}]\label{conj-qlogarithm}
Let $K$ be either $\mathbb{Q}$ or an imaginary quadratic number field, let $q\in K$ be an integral element, and let $z_1,\ldots ,z_m\in K^* \setminus q^{\mathbb{N}}$ be such that $z_\mu /z_{\mu'}\notin q^\mathbb{Z}$ for $\mu\neq \mu'$. Then for each $\ell \in \mathbb{N}$, the $1+\ell m$ numbers 
\begin{equation}\label{Terms-linind}
1,L_q(z_1),\ldots ,L_q(z_m),\ldots ,L_q^{(\ell-1)}(z_1), \ldots,L_q^{(\ell-1)}(z_m) 
\end{equation}
are linearly independent over $K$.  
\end{conjecture} 

\begin{remark}\label{Remark-lindep}
Note that $L_q(z)-L_q (z')\in K$ for all $z,z'\in K^* \setminus q^\mathbb{N}$ with $z/z'\in q^\mathbb{Z}$. Indeed, for all $z\in K$ and $m\in \mathbb{Z}$, it follows that
\[
L_q(zq^m)= \sum_{k=1}^\infty \frac{zq^m}{q^k -zq^m }= \sum_{k=1}^\infty \frac{z}{q^{k-m} -z }.  
\]
Therefore $L_q(zq^m)-L_q(z)\in K$.
\end{remark}

We will apply Conjecture \ref{conj-qlogarithm} with $\ell =1$ to give a conditional proof of the irrationality of $C(b;d)$ for all suitable integers $d\geq 3$, but before that we need some lemmas to obtain the values of $d$ such that $R(b;d)$ is infinite and describe its elements explicitly. Throughout Lemmas \ref{Lemma-Large}--\ref{Lemma-generalgap}, we assume that $n$, $m$, and $d$ are positive integers, $m = n+d$, and both $m$ and $n$ are $b$-adic palindromes. We also write $n$, $m$, and $d$ as 
\begin{align}\label{nml}
&\text{$n=(n_kn_{k-1}\cdots n_1n_0)_b$, $m=(m_{\ell}m_{\ell-1}\cdots m_1 m_0)_b$, and}\notag\\
&\text{$d=(d_r d_{r-1}\cdots d_1 d_0)_b$,}
\end{align}
where $k, \ell, r\geq 0$, $n_k, m_\ell, d_r\neq 0$, and $0\leq n_i, m_i, d_i<b$ for all $i$. 

\begin{lemma}\label{Lemma-Large}
If $0\leq r\leq (k-1)/2$, then $n_i = b-1$ for all $i\in [r,k-r]$. The condition $0\leq r\leq (k-1)/2$ is best possible in the sense that if $k$ is even and $r=k/2$, then there are infinitely many $n$ satisfying all of the other conclusions except for $n_{k/2} = b-1$.
\end{lemma}
\begin{proof}
Let $0\leq r \leq (k-1)/2$. We  first show that
\begin{equation}\label{Inequality-Large}
2b^{r+1} > (n_rn_{r-1}\cdots n_1n_0 )_b+d\geq b^{r+1}.
\end{equation}
Since the two integers in the middle of \eqref{Inequality-Large} are less than $b^{r+1}$, the first inequality holds. Next, suppose that $(n_rn_{r-1}\cdots n_1n_0)_b+d< b^{r+1}$. Then $k=\ell$, $m_i=n_i$ for all $i\in (r,k]$, and 
\begin{equation}\label{Equation-Cont1}
(m_rm_{r-1}\cdots m_1m_0)_b = (n_rn_{r-1}\cdots n_1 n_0)_b+d.
\end{equation}
By \eqref{Equation-Cont1}, we see that $m_j\neq n_j$ for some $j\in [0,r]$, and therefore $m_{k-j} = n_{k-j} = n_j \neq m_j$, which contradicts the assumption that $m$ is a $b$-adic palindrome. So the second inequality in \eqref{Inequality-Large} is proved.

We next show that 
\begin{equation}\label{Equation-Cont1.5}
\text{$n_i = b-1$ for all $i\in (r,k-r)$.}
\end{equation}
We note that if $r\leq (k-2)/2$, then the interval $(r,k-r)$ is not empty and we need to prove that \eqref{Equation-Cont1.5} holds. If $r = (k-1)/2$, then $(r,k-r)\cap \mathbb Z = \emptyset$; in this case, we can skip the proof of \eqref{Equation-Cont1.5} and proceed to the proof of \eqref{Equation-Cont1.5(9.5)}. So in the proof of \eqref{Equation-Cont1.5}, we assume that $r\leq (k-2)/2$. 

Suppose $n_i\neq b-1$ for some $i\in \left(r,\left\lceil \frac k2\right\rceil\right)$. Let $j$ be the smallest integer in $\left(r,\left\lceil \frac k2\right\rceil\right)$ such that $n_j\neq b-1$. Then $n_i = b-1$ for $i\in (r,j)$, and by \eqref{Inequality-Large}, we also obtain $m_j = n_j+1$, $k=\ell$, and $m_i = n_i$ for all $i\in (j,k]$. Therefore $n_j+1 = m_j = m_{k-j} = n_{k-j} = n_j$, which is a contradiction. Thus $n_i = b-1$ for all $i\in \left(r,\left\lceil \frac k2\right\rceil\right)$. Since $n$ is a palindrome, we obtain that $n_{k-i} = n_i = b-1$ for all $i\in \left(r,\left\lceil \frac k2\right\rceil\right)$. So, if $k$ is odd, then \eqref{Equation-Cont1.5}  is proved. If $k$ is even, then $n_i = b-1$ for all $i\in (r,k-r)\setminus \left\{\frac k2\right\}$, and it remains to show that $n_{\frac k2} = b-1$. So let $k$ be even and suppose that $n_{\frac k2}\neq b-1$. Then by \eqref{Inequality-Large}, we obtain $m_{\frac k2} = n_{\frac k2}+1$, $k=\ell$, $m_i=n_i$ for all $i\in \left(\frac k2,k\right]$, and $m_i = 0$ for all $i\in \left(r,\frac k2\right)$. If $r\leq \frac k2-2$, then $0 = m_{\frac k2-1} = m_{\frac k2+1} = n_{\frac k2+1} =n_{\frac k2-1} = b-1$, a contradiction. So $r = \frac k2-1$. Since $m_i=n_i$ for all  $i\in \left(\frac k2,k\right]$, we obtain that $m_i = m_{k-i}=n_{k-i}=n_i$ for all $i\in [0,r]$. Therefore $m_i = n_i$ for all $i\neq \frac k2$ and $m_{\frac k2} = n_{\frac k2}+1$. Thus $b^{\frac k2} = b^{r+1} > d = m-n = b^{\frac k2}$, which is not possible. Hence $n_{\frac k2} = b-1$ and \eqref{Equation-Cont1.5} is proved.

The remaining part of the proof is to show 
\begin{equation}\label{Equation-Cont1.5(9.5)}
n_{r}=n_{k-r}=b-1.
\end{equation}
Suppose that $n_{k-r}<b-1$. By \eqref{Inequality-Large} and \eqref{Equation-Cont1.5}, it follows that $k=\ell$, $m_{k-r}=n_{k-r}+1$, and $m_r = d_r+n_r+i-b$, where $i=0$ or $1$. Therefore 
\[
d_r+n_r+i-b=m_r= m_{k-r}= n_{k-r}+1= n_r +1\geq n_r+i,  
\]
and so $d_r\geq b$, which is a contradiction. Hence $n_r = n_{k-r} = b-1$ and the proof of the first part is complete. For the second part, let $k$ be an even integer not less than $2$, $r = k/2$, $d = b^{k/2}$, $n = \sum_{0\leq i\leq k}n_ib^i$, where $n_k\neq 0$, $n_{k/2}\in [0,b-2]$, $n_i\in [0,b)$, $n_i = n_{k-i}$ for all $i\in [0,k]$, and $m=n+d$. Then $m$ and $n$ are $b$-adic palindromes and $n_{k/2}\neq b-1$. Since $k$ is arbitrary, there are infinitely many such $n$, and the second part of this lemma is proved. 
\end{proof}
We remark that the example given in the second part of the proof of
Lemma \ref{Lemma-Large} was also used in the construction of the longest
arithmetic progressions of palindromes in base $b=10$ by Pongsriiam
\cite{Pong}. It will be used again in a forthcoming article of
Phunphayap and Pongsriiam on longest
arithmetic progressions of $b$-adic palindromes
for all large $b$. So the optimal bound $0\leq r\leq (k-1)/2$ in Lemma
\ref{Lemma-Large} may not be necessary in this paper, but it will be
useful in the future. Similarly, Lemma \ref{Lemma-d=2} is given in an
optimal form as follows.

\begin{lemma}\label{Lemma-d=2}
If $0\leq r\leq k/2$ and $n_i = b-1$ for all $i\in [0,k]$, then $d=2$. If $k$ is odd, $r=\frac{k+1}{2}$, and $n_i = b-1$ for all $i\in [0,k]$, then $d\geq 2$ and if $d\neq 2$, then the smallest possible value of $d$ is $d = 2+b^{\frac{k+1}{2}}$. In particular, the bound $0\leq r\leq k/2$ in the first statement is optimal.
\end{lemma}
\begin{proof}
For the first statement, assume that $0\leq r\leq k/2$ and $n_i = b-1$ for all $i\in [0,k]$. 
Then $n=b^{k+1}-1$. By $m=n+d=b^{k+1}+(d-1)$ and $0\leq d-1<b^{r+1}$, we have $\ell=k+1$, $m_{k+1}=1$, and $m_i=0$ for all $i\in(r,k]$. Since $m$ is a $b$-adic palindrome, we have $m_0 = 1$. Since $m$ is a $b$-adic palindrome, we conclude that $m_i = 0$ for all $i\in [1,k]$. Hence $m = b^{k+1}+1$. Therefore 
$$
d = m-n = \left(b^{k+1}+1\right)-\left(b^{k+1}-1\right)=2,
$$
as required. Next, let $k$ be odd, $r=\frac{k+1}{2}$, and $n_i = b-1$ for all $i\in [0,k]$. Then $n = b^{k+1}-1$ and it is obvious that $n+1$ is not a $b$-adic palindrome. So $d\geq 2$. So assume that $d\neq 2$. Then $m>b^{k+1}+1$ and the smallest $b$-adic palindrome larger than $b^{k+1}+1$ is $b^{k+1}+1+b^{\frac{k+1}{2}}$. Therefore the smallest value of $d$ is 
$$
d = \left(b^{k+1}+1+b^{\frac{k+1}{2}}\right)-\left(b^{k+1}-1\right) = 2+b^{\frac{k+1}{2}}.
$$ 
This completes the proof.
\end{proof}
After we have Lemma \ref{Lemma-Large}, we can split our consideration into two cases. The first case is that $n_i = b-1$ for all $i\in [0,r)$, which leads to Lemma \ref{Lemma-d=2}. The second case is that $n_j\neq b-1$ for some $j\in [0,r)$ which is considered in the next lemma as follows.

\begin{lemma}\label{Lemma-generalgap} 
Let $1\leq r\leq (k-1)/2$ and let $j$ be the largest integer in the interval $[0,r)$ such that $n_j<b-1$. Then $j=r-1$ and $d=b^r+b^{r-1}$. Furthermore, if $b=2$, then $r\geq 2$. 
\end{lemma}
\begin{proof} 
We first note that since $n_{k-j} = n_j<b-1$ and $j\leq r-1$, we have $n\leq b^{k+1}-1-b^{k-j} \leq b^{k+1}-1-b^{k-r+1}$ and so 
$$
m = n+d \leq b^{k+1}-1-b^{k-r+1}+b^{r+1}<b^{k+1}.
$$
Therefore $\ell=k$. Next, we suppose by way of contradiction that $j<r-1$. The choice of $j$ implies that $n_i=b-1$ for all $i\in (j,r)$. By applying Lemma \ref{Lemma-Large}, we also have $n_i=b-1$ for all $i\in [r, k-r]$. Since $n$ is a $b$-adic palindrome, we obtain $n_i=b-1$ for all $i\in (j,k-j)$. We assert that 
\begin{equation}\label{Lemma-generalgapeq100}
(n_{j}\cdots n_0)_b+(d_{j}\cdots d_0)_b< b^{j+1}. 
\end{equation}
If \eqref{Lemma-generalgapeq100} does not hold, then it follows that $m_i = d_i$ for all $i\in (j,r]$, $m_i=0$ for all $i\in (r,k-j)$, and $m_{k-j} = n_{k-j}+1$, which implies $0 = m_{k-r} = m_r = d_r$, a contradiction. Thus \eqref{Lemma-generalgapeq100} holds. Similarly, if there exists an integer $i\in (j,r)$ such that $d_i>0$, then we obtain $0 = m_{k-r} = m_r = d_r$, which is not possible. Therefore $d_i=0$ for all $i\in (j,r)$.

Combining the above discussion, we have
\begin{align} 
d_i &= 0\; \text{for $j < i < r$},\label{Equation-ell}\\ 
(m_{j}&\cdots m_{0})_b =(n_{j}\cdots n_0)_b +(d_{j}\cdots d_0)_b<b^{j+1},\label{Equation-smalldegits} \\ 
\ell&=k,  m_i=n_i\; \text{for $k-j < i\leq k$},\; m_{k-j}=n_{k-j}+1,\label{Equation-key1}\\ 
m_i&=0\; \text{for $r < i < k-j$}, \; m_r=d_r-1,\label{Equation-key2}\\ 
m_{i}&=b-1\; \text{for $j < i < r$}. \label{Equation-key3} 
\end{align}
Recall that $j+1<r$. So we can substitute $i=k-j-1$ in \eqref{Equation-key2} and $i = j+1$ in \eqref{Equation-key3} to obtain $0 = m_{k-j-1} = m_{j+1} = b-1$, which is a contradiction. Therefore $j = r-1$. Then \eqref{Equation-smalldegits}, \eqref{Equation-key1}, and \eqref{Equation-key2} can be rewritten as 
\begin{align}
(m_{r-1}&\cdots m_{0})_b =(n_{r-1}\cdots n_0)_b +(d_{r-1}\cdots d_0)_b<b^{r},\label{Equation-smalldegits16} \\ 
\ell&=k,  m_i=n_i\; \text{for $k-r+1 < i\leq k$},\; m_{k-r+1}=n_{k-r+1}+1,\label{Equation-key117}\\ 
m_i&=0\; \text{for $r < i \leq k-r$}, \; m_r=d_r-1.\label{Equation-key218}
\end{align}
Then \eqref{Equation-key218} implies that $0 = m_{k-r} = m_r = d_r-1$, and so $d_r = 1$. Next, we assert that 
\begin{equation}\label{Lemma-generalgapeq200}
d_i = 0\quad \text{for every $i \in [0,r-1)$}.
\end{equation}
Suppose that \eqref{Lemma-generalgapeq200} does not hold. Let $j'$ be the smallest integer in the interval $[0,r-1)$ such that $d_{j'}\neq 0$. Then we substitute $i = k-j'$ in \eqref{Equation-key117} to obtain $m_{k-j'} = n_{k-j'}$. In addition, since $d_i = 0$ for all $i\in [0,j')$, we obtain that $m_{j'} = n_{j'}+d_{j'}$ or $m_{j'} = n_{j'}+d_{j'}-b$. Therefore
$$
n_{j'} = n_{k-j'} = m_{k-j'}= m_{j'} \equiv n_{j'}+d_{j'} \pmod b,
$$ 
which implies $d_{j'}=0$ contradicting the choice of $j'$. Hence \eqref{Lemma-generalgapeq200} holds. Then \eqref{Equation-key117}, \eqref{Equation-smalldegits16}, and \eqref{Lemma-generalgapeq200} imply that $n_{k-{r+1}}+1=m_{k-r+1} = m_{r-1}=n_{r-1}+d_{r-1}=n_{k-r+1}+d_{r-1}$, and hence $d_{r-1}=1$. Therefore $d = b^{r}+b^{r-1}$. 

In the case $b=2$ and $r=1$, we see that $d=(11)_2$ and $m_0\in \{0,1\}$. However, it is easy to see that $m_0=0$ implies $m_k=m_0=0$, and $m_0=1$ implies $n_k = n_0 = 0$, which is  a contradiction. Thus, if $b=2$, then $r\geq 2$. This completes the proof.
\end{proof}
We are now ready to give the proof of the desired results. In the statement of the next theorem, we call a pair $(r,b)$ of integers \textit{admissible} if $(r,b)$ satisfies that $r\geq 2$ if $b=2$, and $r\geq 1$ otherwise. For every admissible pair $(r,b)$, we find the explicit forms of all except a finite number of elements of $R(b;d)$ as follows. 

\begin{theorem}\label{thm-gentwin1}
Let $b$ and $d$  be integers, $b\geq 2$, and $d\geq 1$. Then the following statements hold.
\begin{itemize}
\item[{\rm (i)}] If $b=2$, then $R(b;d)$ is infinite if and only if $d=2$ or $d=2^r+2^{r-1}$ for some $r\geq 2$. 
\item[{\rm (ii)}] If $b\geq 3$, then $R(b;d)$ is infinite if and only if  $d=2$ or $d=b^r+b^{r-1}$ for some $r\geq 1$.
\item[{\rm (iii)}] For every admissible pair $(r,b)$, there exists an exceptional finite set $\mathcal{E}=\mathcal{E}(r,b)\subseteq \mathbb{N}^2$ such that $(n,m)\in R(b;b^r+b^{r-1})\setminus \mathcal{E}$ if and only if 
\begin{align}\label{thm-gentwin1(iii)eq1}
n&=\sum_{0\leq i < r} n_i b^{k-i} + (b-1)\sum_{r\leq i\leq k-r} b^i + \sum_{0\leq i < r} n_{i} b^{i},\;\text{and}\\
m&= n+b^r+b^{r-1}\notag  
\end{align}
for some integers $k\geq 2r+1$, $n_0\in [1,b)$, $n_{r-1}\in [0,b-1)$, and $n_i\in [0,b)$ for all $i\in (0,r-1)$.
\end{itemize}
\end{theorem}
\begin{remark}
If $r=1$, then \eqref{thm-gentwin1(iii)eq1} in Theorem \ref{thm-gentwin1} means that $b\geq 3$, $k\geq 3$, $1\leq n_0<b-1$, and 
$$
n = n_0b^k+(b-1)\sum_{1\leq i\leq k-1}b^i+n_0,
$$
and therefore $n+b^r+b^{r-1} = (n_0+1)b^k+(n_0+1)$. If $r\geq 2$ and $n$ is defined as in \eqref{thm-gentwin1(iii)eq1}, then 
\begin{align*}
n+b^r+b^{r-1} &= \sum_{0\leq i<r-1}n_ib^{k-i}+(n_{r-1}+1)b^{k-r+1}+(n_{r-1}+1)b^{r-1}\\
&\quad +\sum_{0\leq i<r-1}n_ib^i\\
&= \sum_{0\leq i<r}n_ib^{k-i}+b^{k-r+1}+b^{r-1}+\sum_{0\leq i<r}n_ib^i.
\end{align*}
In addition, we can also rewrite \eqref{thm-gentwin1(iii)eq1} as 
\begin{equation}\label{thm-gentwin1(iii)eq1rewrite}
n = \sum_{0\leq i<r}n_ib^{k-i}+b^{k-r+1}-b^r+\sum_{0\leq i<r}n_ib^i.
\end{equation}
We use the form \eqref{thm-gentwin1(iii)eq1} in the proof of Theorem  \ref{thm-gentwin1} and use both \eqref{thm-gentwin1(iii)eq1} and \eqref{thm-gentwin1(iii)eq1rewrite} in the proof of Theorem \ref{thm-gentwin3}. 
\end{remark}
\begin{proof}[Proof of Theorem \ref{thm-gentwin1}]
It is easy to see that $(b^k-1,b^k+1)\in R(b;2)$ for all $k\in \mathbb N$, and so $R(b;d)$ is infinite when $d=2$. Next, let $r\geq 2$ and $d = b^r+b^{r-1}$. Let $n$ be defined as in \eqref{thm-gentwin1(iii)eq1} and let $m=n+d$. Then it is not difficult to check that $(n,m)\in R(b;d)$. Since $k$ is an arbitrary integer not less than $2r+1$, there are infinitely many $n$ satisfying \eqref{thm-gentwin1(iii)eq1}. Therefore $R(b;d)$ is infinite. In the case $b\geq 3$ and $r = 1$, the above proof still works. So the \lq\lq if\rq\rq\ parts of (i) and (ii) are proved. In addition, the set 
\begin{equation}\label{thm-gentwin1(iii)eq11000}
\mathcal{E} = \mathcal E(r,b) = \left\{(n',m')\in \mathbb N^2\mid n'<b^{2r+1}\;\text{and}\; m' = n'+d\right\}
\end{equation}
is finite  and does not contain $(n,m)$. So $(n,m)\in R(b;d)\setminus\mathcal E$. This proves the \lq\lq if\rq\rq\ part of (iii).

Next, assume that $R(b;d)$ is infinite. Let $\mathcal E$ be defined as in \eqref{thm-gentwin1(iii)eq11000}. Then $\mathcal E$ is finite, and so $R(b;d)\setminus \mathcal E$ is infinite. Let $(n,m)\in R(b;d)\setminus \mathcal E$. Then $n$ and $m$ are $b$-adic palindromes, $m=n+d$, and $n\geq b^{2r+1}$. We write $n$, $m$, and $d$ as in \eqref{nml}. Then $0\leq r\leq(k-1)/2$. By Lemma \ref{Lemma-Large}, we obtain $n_i = b-1$ for all $i\in [r,k-r]$. If $r=0$, then this means that $n_i = b-1$ for all $i\in [0,k]$, and we can apply Lemma \ref{Lemma-d=2} to obtain $d=2$, which proves the \lq\lq only if\rq\rq\ parts of (i) and (ii). If $n_i = b-1$ for all $i\in [0,r)$, then this also leads to Lemma \ref{Lemma-d=2} and the conclusion that $d=2$. So assume that $r\geq 1$ and $j$ is the largest integer in $[0,r)$ such that $n_j < b-1$. Then Lemma \ref{Lemma-generalgap} implies the \lq\lq only if\rq\rq\ parts of (i) and (ii). 

So it remains to prove the \lq\lq only if\rq\rq\ part of (iii). We now have $(n,m)$ in $R(b;d)\setminus \mathcal E$ where $d = b^r+b^{r-1}$, $r\in \mathbb N$, and $r\geq 2$ if $b=2$. We also have $k\geq 2r+1$, $n_i = b-1$ for all $i\in [r,k-r]$, $n_j = n_{r-1}<b-1$. Since $n$ is a $b$-adic palindrome, we have $n_0\neq 0$. Therefore $n_0\in [1,b)$, $n_{r-1}\in[0,b-1)$, $n_i\in [0,b)$ for all $i\in [0,k]$, and $n_i = n_{k-i}$ for all $i\in [0,k]$. Hence $n$ is of the form \eqref{thm-gentwin1(iii)eq1}. This proves the \lq\lq only if\rq\rq\ part of (iii) and so the proof is complete.
\end{proof}

\begin{theorem}\label{thm-gentwin3}
Assume that Conjecture \ref{conj-qlogarithm} with $\ell=1$ is true. Then for every admissible pair $(r,b)$, the constant $C(b;b^r+b^{r-1})$ is irrational.
\end{theorem}
\begin{proof}
 Fix an admissible pair $(r,b)$. For $n = (n_kn_{k-1}\cdots n_r\cdots n_0)_b$ with $n_0\in [1,b)$, $n_{r-1}\in [0,b-1)$, and $n_i\in [0,b)$ for all $i\in (0,r-1)$, we define 
\begin{align*}
Q &= Q(n) = Q(n_0,\ldots, n_r, \ldots, n_k)= b^{r} +\sum_{0\leq i< r} n_i b^{2r-1-i},   \\
P_0 &= P_0(n) = P_0(n_0,\ldots, n_r, \ldots, n_k)= b^{r} - \sum_{0\leq i< r} n_i b^i,  \\
P_1 &= P_1(n) = P_1(n_0,\ldots, n_r, \ldots, n_k)= -b^{r-1} - \sum_{0\leq i< r} n_i b^i.
\end{align*}
By Theorem \ref{thm-gentwin1}, the constant $C(b;b^r+b^{r-1})$ is irrational if and only if the sum 
\begin{equation}\label{thm13QP0P1eq1}
\sum_n\left(\frac 1n+\frac{1}{n+b^r+b^{r-1}}\right) = \sum_{n_0,n_1,\ldots,n_{r-1}}\sum_{k=2r+1}^\infty \left(\frac 1n+\frac{1}{n+b^r+b^{r-1}}\right)
\end{equation}
is irrational, where $n$ ranges over all positive integers of the form \eqref{thm-gentwin1(iii)eq1} satisfying that $n_0\in [1,b)$, $n_{r-1}\in [0,b-1)$, and $n_i\in [0,b)$ for all $i\in (0,r-1)$. By adding the finite number of terms with $k=2r$, we can replace $\sum_{k=2r+1}^\infty$ with $\sum_{k=2r}^\infty$ in \eqref{thm13QP0P1eq1} and obtain that $C(b;b^r+b^{r-1})$ is irrational if and only if
\begin{align} \nonumber
\sum_{n_0,n_1,\ldots,n_{r-1}}\sum_{k=2r}^\infty &\left(\frac 1n+\frac{1}{n+b^r+b^{r-1}}\right) \\ \nonumber
&=\sum_{n_0,n_1,\ldots,n_{r-1}} \left( \sum_{k=1}^\infty    \frac{1}{Qb^k -P_0} +  \sum_{k=1}^\infty    \frac{1}{Qb^k -P_1}   \right) \\ \label{Series-generalgaps} 
&= \sum_{n_0,n_1,\ldots,n_{r-1} } \frac{L_b(P_0/Q)}{P_0} + \sum_{n_0,n_1,\ldots,n_{r-1} } \frac{L_b(P_1/Q)}{P_1}
\end{align}
is irrational. We remark that $P_i/Q\neq b^k$ for all $k\geq 1$ and $i\in \{0,1\}$. 
Let $S_0$ and $S_1$ be the first and second sums in \eqref{Series-generalgaps}, respectively. For each $i\in \{0,1\}$ and $n\in \mathbb{N}$, we define $z_{n}^{(i)}= P_i(n)/Q(n)$.  The sign of each $P_i$ is $(-1)^i$ by the definition of $P_i$. So we have $z_n^{(0)}>0$ and $z_n^{(1)}<0$ for all $n$. By Remark \ref{Remark-lindep} and combining terms $L_b(z_n^{(i)})$ and $L_b(z_{n'}^{(i)})$ in $S_i$ satisfying $z_{n}^{(i)}/z_{n'}^{(i)}\in  b^\mathbb{Z}$, the sum $S_i$ can be rewritten as
\[
B^{(i)}+ \sum_{n}A_n^{(i)} L_b(z_n^{(i)}), 
\] 
where the sum is taken over all a finite number of $n$, $B^{(i)}\in \mathbb{Q}$, $A_n^{(i)}\in \mathbb{Q}^*$, $(-1)^i A_n^{(i)}>0$, $z_n^{(i)}\in \mathbb{Q}^*\setminus b^{\mathbb{N}}$, $(-1)^iz_n^{(i)}>0$, and $z_n^{(i)}/z_{n'}^{(i)}\notin b^\mathbb{Z}$ for $n\neq n'$. Therefore \eqref{Series-generalgaps} is equal to 
\[
B^{(0)}+B^{(1)}+\sum_{n}A_n^{(0)} L_b(z_n^{(0)})+\sum_{n}A_n^{(1)} L_b(z_n^{(1)}).
\]
We remark that $z_n^{(1)}/z_{n'}^{(0)}<0$ implies $z_n^{(1)}/z_{n'}^{(0)}\notin b^\mathbb{Z}$. Hence, Conjecture \ref{conj-qlogarithm} with $\ell=1$ implies the irrationality of  \eqref{Series-generalgaps}.
\end{proof}

In the next subsection, we first give a lemma which is a key to the construction of large gaps between $b$-adic antipalindromes of types 0, 1, and 2. 

\subsection{Antipalindromes of types 0, 1, and 2 in short intervals}

From this point on, for each $n\in \mathbb N$ and $j=0, 1, 2$, we let $f_j(n)$ be the smallest $b$-adic antipalindrome of type $j$ that is larger than $n$.
\begin{lemma}\label{lemma3.5f(n)}
Let $b$ and $k$ be integers larger than $1$.  Then the following statements hold.
\begin{itemize}
\item[{\rm(i)}] For each $j\in \{0,1,2\}$, the $b$-adic antipalindromes of type $j$ are uniquely determined by their first half digits. More precisely, if $y = \sum_{i=0}^k y_ib^i$ and $n = \sum_{i=0}^kn_ib^i$ are $b$-adic antipalindromes of the same type $j\in \{0,1,2\}$ and $y_i = n_i$ for each $i\geq \left\lceil k/2\right\rceil$, then $y=n$. 
\item[{\rm(ii)}] For each $j \in\{0, 1\}$, if $n$ is a $b$-adic antipalindrome of type $j$, then $n$ is a $b$-adic antipalindrome of type $j+1$.
\item[{\rm(iii)}] For each $n\in \mathbb N$, we have $f_0(n)\geq f_1(n)\geq f_2(n)$.
\item[{\rm(iv)}] If $n = b^k$, then $f_2(n) = b^k+b^{\left\lceil \frac k2\right\rceil}-2$.
\item[{\rm(v)}] If $n =  b^{k+1}-b^{\left\lceil \frac k2\right\rceil}$, then $f_2(n) =  b^{k+1}+b^{\left\lceil \frac{k+1}{2}\right\rceil}-2$.
\item[{\rm(vi)}] If $n = b^k+b^{k-j}-b^{\frac{k+1}{2}}+b^{j+1}-2$ where $k\geq 11$, $k$ is odd, and $j = \left\lfloor k/3\right\rfloor$, then $f_2(n) = b^k+b^{k-j}+b^{\frac{k+1}{2}}-b^j-2$. 
\item[{\rm(vii)}] If $n = b^k+b^{k-j}-b^{\frac{k}{2}+1}+\left(\frac{b-1}{2}\right)b^{\frac k2}+b^{j+1}-2$ where $k\geq 10$, $k$ is even, and $j = \left\lfloor k/3\right\rfloor$, then $f_1(n) = b^k+b^{k-j}+\left(\frac{b+1}{2}\right)b^{\frac{k}{2}}-b^j-2$.
\end{itemize}
\end{lemma}
\begin{proof}
The statements (i) to (iii) are obvious, so we skip the proof. Next, we prove (iv). Let 
$$
n = b^k = (n_kn_{k-1}\cdots n_0)_b\;\text{and}\; m = b^k+b^{\left\lceil \frac k2\right\rceil}-2 = (m_km_{k-1}\cdots m_0)_b,
$$
where $n_k = 1$, $n_i = 0$ for all $i<k$, $m_k = 1$, $m_i = 0$ for $\left\lceil k/2\right\rceil\leq i<k$, $m_i = b-1$ for $0<i<\left\lceil k/2\right\rceil$, and $m_0 = b-2$. It is straightforward to check that $m$ is a $b$-adic antipalindrome of type 2 larger than $n$. Suppose that $y$ is a $b$-adic antipalindrome of type 2 satisfying $n<y\leq m$. By comparing the digits of $n, y, m$, we see that $y_i = m_i$ for all $i\geq \left\lceil k/2 \right\rceil$. Therefore we obtain by (i) that $y=m$. This shows that $f_2(n) = m$. 

Next, let $n = b^{k+1}-b^{\left\lceil \frac k2\right\rceil} = (n_kn_{k-1}\cdots n_0)_b$ where $n_i = b-1$ for $i\geq \left\lceil k/2\right\rceil$ and $n_i = 0$ for $i<\left\lceil k/2\right\rceil$. Let $m = b^{k+1}+b^{\left\lceil \frac{k+1}{2}\right\rceil}-2$ and let $y$ be a $b$-adic antipalindrome of type 2 satisfying $n<y\leq m$. If $n < y < b^{k+1}$, then $y = (y_k\cdots y_0)_b$ where $y_i = b-1$ for $i\geq \left\lceil k/2\right\rceil$ and $y_j>0$ for some $j<\left\lceil k/2\right\rceil$, which implies that $y$ is not a $b$-adic antipalindrome of type 2, a contradiction. So $b^{k+1}\leq y \leq m$. Then the first half digits of $y$ and $m$ are the same. So we obtain by (i) that $y=m$. This shows that $f_2(n) = m$. 

Next, let $n$ be defined as in (vi). Then 
$$
n = b^k+(b-1)\sum_{\frac{k+1}{2}\leq i\leq k-j-1}b^i + (b-1)\sum_{1\leq i\leq j}b^i+(b-2)=(n_kn_{k-1}\cdots n_0)_b,
$$
where $n_k=1$, $n_i = b-1$ for $i\in[1,j]\cup \left[\frac{k+1}{2},k-j-1\right]$, $n_0=b-2$, and $n_i=0$ otherwise. Let $y$ be the smallest $b$-adic antipalindrome larger than $n$. By comparing the digits as in the proof of (iv) and (v), we see that if 
$$
n<y < b^k+b^{k-j},
$$
then $y$ is not a $b$-adic antipalindrome. Therefore 
$$
y\geq b^k+b^{k-j}.
$$
Let $m = b^{k} + b^{k-j}+b^{\frac{k+1}{2}}-b^j-2 = (m_km_{k-1}\cdots m_0)_b$ where $m_k = m_{k-j} = 1$, $m_j = m_0 = b-2$, $m_i = b-1$ for $i\in \left(0,j\right)\cup \left(j,\frac{k+1}{2}\right)$, and $m_i = 0$ otherwise. Then $m$ is a $b$-adic antipalindrome larger than $n$. Therefore $b^k+b^{k-j}\leq y\leq m$. By comparing the digits of $b^k+b^{k-j}$, $m$, $y$, and applying (i), we obtain that $f_2(n) = y = m$. 

Next, let $n$ be defined as in (vii). The proof of (vii) is similar to (vi), so we skip some details. We have 
$$
n = b^k+(b-1)\sum_{\frac k2<i<k-j}b^i+\left(\frac{b-1}{2}\right)b^{\frac k2}+(b-1)\sum_{1\leq i\leq j}b^i+(b-2).
$$
By comparing the digits, we see that there is no $b$-adic antipalindromes that lie in the interval $(n,n+y]$ where $y = b^{\frac k2}-b^{j+1}+1$. In addition, the integers in the interval $\left[n+y+1,b^k+b^{k-j}+\left(\frac{b-1}{2}\right)b^{\frac k2}\right)$ are not $b$-adic antipalindromes since their middle digits (the digit corresponding to $b^{\frac k2}$) are not $\frac{b-1}{2}$. Therefore $f_1(n) \geq b^k+b^{k-j}+\left(\frac{b-1}{2}\right)b^{\frac k2}$. Let $m = b^k+b^{k-j}+\left(\frac{b+1}{2}\right)b^{\frac k2}-b^j-2$. Then $m$ is a $b$-adic antipalindrome larger than $n$. Therefore 
$$
b^k+b^{k-j}+\left(\frac{b-1}{2}\right)b^{\frac k2}\leq f_1(n)\leq m.
$$
By comparing the digits and applying (i), we obtain $f_1(n)=m$, as required. This completes the proof.
\end{proof}
\begin{theorem}\label{thm7anti}
Let $b$ be an integer not less than $2$ and $(x_n)$ the strictly increasing sequence of $b$-adic antipalindromes of type 2 (free middle type). Then 
\begin{equation}\label{antieq1}
x_{n+1}-x_n \leq 2\sqrt b\sqrt{x_n}\quad\text{for all $n\in \mathbb N$},
\end{equation}
and \eqref{antieq1} is sharp in the sense that 
$$
\limsup_{n\to\infty}\frac{x_{n+1}-x_n}{\sqrt{x_n}} = 2\sqrt b.
$$
\end{theorem}
\begin{proof}
Throughout the proof, all $b$-adic antipalindromes are of type 2. Let $n$ be a $b$-adic antipalindrome, and write $n= (n_kn_{k-1}\cdots n_0)_b$ with $n_k\neq 0$. Let $m = f_2(n)$. If $1\leq n<b-1$, then $m=n+1$ and so $m-n<2\sqrt b\sqrt n$. It is easy to see that $b, b+1, \ldots, b+(b-3)$ are not $b$-adic antipalindromes, but $b+(b-2)$ is. So if $n = b-1$, then $m=2n$, and so $m-n < 2\sqrt b\sqrt n$. By listing all $b$-adic antipalindromes in $[b,b^3]$, it is straightforward to check that if $b\leq n<b^3$, then $m-n \leq 2b-2 < 2\sqrt b\sqrt n$. So we assume that $n\geq b^3$. Therefore $k\geq 3$. Next, we split the calculations into 6 cases.

\bigskip\noindent
\textbf{Case 1:} $k$ is odd and $n_{\frac{k+1}{2}}\neq b-1$. Then $n_{\frac{k-1}{2}}\geq 1$. Let $y = b^{\frac{k+1}{2}}-b^{\frac{k-1}{2}} = (b-1)b^{\frac{k-1}{2}}$. Then $n+y$ is a $b$-adic antipalindrome, and so $m\leq n+y$. Therefore 
$$
\frac{m-n}{\sqrt n}\leq \frac{y}{\sqrt n} \leq \frac{b^{\frac{k+1}{2}}-b^{\frac{k-1}{2}}}{\sqrt{b^k}} = \sqrt b-\sqrt{b^{-1}},
$$
which is less than $2\sqrt b$.

\bigskip\noindent
\textbf{Case 2:} $k$ is even and $n_{\frac k2}\neq b-1$. Then $n+b^{\frac k2}$ is a $b$-adic antipalindrome. Therefore $m-n\leq b^{\frac k2} < \sqrt n < 2\sqrt b\sqrt n$. 

\bigskip\noindent
\textbf{Case 3:} $k$ is even and $n_i = b-1$ for all $i\geq k/2$. Then $n_i = 0$ for all $i<k/2$, and so $n = b^{k+1}-b^{\frac k2}$. By Lemma \ref{lemma3.5f(n)}, we obtain $m = b^{k+1}+b^{\frac{k+2}{2}}-2$. If $b\geq 3$, then
$$
\frac{m-n}{\sqrt n}<\frac{b^{\frac{k+2}{2}}+b^{\frac{k}{2}}}{\sqrt{b^{k+1}-b^{\frac k2}}} <\frac{b^{\frac{k+2}{2}}+b^{\frac{k}{2}}}{\sqrt{b^{k+1}/2}} =\sqrt 2\left(\sqrt b+\sqrt{b^{-1}}\right)  < 2\sqrt b.
$$
Since $k\geq 3$ and $k$ is even, we have $k\geq 4$. So if $b=2$, then  
$$
\frac{m-n}{\sqrt n}<\frac{2^{\frac{k+2}{2}}+2^{\frac{k}{2}}}{\sqrt{2^{k+1}-2^{\frac k2}}} = \frac{\sqrt2+\sqrt{2^{-1}}}{\sqrt{1-2^{-(k+2)/2}}} \leq \frac{\sqrt2+\sqrt{2^{-1}}}{\sqrt{7/8}} < 2\sqrt 2.
$$
So, in any case, we have $m-n < 2\sqrt b\sqrt n$.

\bigskip\noindent
\textbf{Case 4:} $k$ is even, $n_{\frac k2} = b-1$, and $n_i\neq b-1$ for some $i>k/2$. Then $n_i\neq 0$ for some $i<k/2$. Let $j$ be the largest integer less than $\frac k2$ such that $n_j\neq 0$. Then $n_{k-j}\neq b-1$. Let
$$
y = 2b^{\frac k2}-b^{j+1}-b^j = b^{\frac k2}+(b-1)\sum_{j<i<\frac k2}b^i-b^j.
$$ 
Then $n+y$ is a $b$-adic antipalindrome, and so $m-n\leq y<2b^{\frac k2}<2\sqrt n < 2\sqrt b\sqrt n$.

\bigskip\noindent
\textbf{Case 5:} $k$ is odd and $n_i=b-1$ for all $i\geq \frac{k+1}{2}$. Then $n_i = 0$ for all $i\leq \frac{k-1}{2}$ and so $n = b^{k+1}-b^{\frac{k+1}{2}}$. By Lemma \ref{lemma3.5f(n)}, we obtain $m = b^{k+1}+b^{\frac{k+1}{2}}-2$. Therefore 
$$
m-n < 2b^{\frac{k+1}{2}} = 2\sqrt b\cdot b^{\frac k2} < 2\sqrt b\sqrt n.
$$

\bigskip\noindent
\textbf{Case 6:} $k$ is odd, $n_{\frac{k+1}{2}} = b-1$, and $n_i \neq b-1$ for some $i>\frac{k+1}{2}$. Then $n_i\neq 0$ for some $i<\frac{k-1}{2}$. Let $j$ be the largest integer less than $\frac{k-1}{2}$ such that $n_j\neq 0$. Then $n_{k-j}\neq b-1$. Let 
$$
y = 2b^{\frac{k+1}{2}}-b^{j+1}-b^j = b^{\frac{k+1}{2}}+(b-1)\sum_{j<i<\frac{k+1}{2}}b^i-b^j.
$$
 Then $n+y$ is a $b$-adic antipalindrome. Therefore
$$
m-n \leq y < 2b^{\frac{k+1}{2}} = 2\sqrt b\cdot b^{\frac k2} < 2\sqrt b\sqrt n.
$$
From Cases 1--6, we conclude that $x_{n+1}-x_n \leq 2\sqrt b\sqrt{x_n}$ for all $n\geq 1$.

For the limit supremum, we construct a specific $n$ similar to Case 6 where $k\geq 11$, $k$ is odd, and $j = \left\lfloor k/3\right\rfloor$. That is, we let  
\begin{align*}
n &= b^k+(b-1)\sum_{\frac{k+1}{2}\leq i\leq k-j-1}b^i + (b-1)\sum_{1\leq i\leq j}b^i+(b-2)\\
&=b^k+b^{k-j}-b^{\frac{k+1}{2}}+b^{j+1}-2,
\end{align*}
where $k\geq 11$, $k$ is odd, and $j = \left\lfloor k/3\right\rfloor$. By Lemma \ref{lemma3.5f(n)}, we obtain  
$$
m = b^k+b^{k-j}+b^{\frac{k+1}{2}}-b^j-2.
$$
Therefore
$$
\frac{m-n}{\sqrt n} = \frac{2b^{\frac{k+1}{2}}-b^{j+1}-b^j}{\sqrt n} = \frac{2\sqrt b-b^{j+1-\frac k2}-b^{j-\frac k2}}{\sqrt{1+b^{-j}-b^{\frac{1-k}{2}}+b^{j+1-k}-2b^{-k}}},
$$
which converges to $2\sqrt b$ as $k\to\infty$. Therefore $(m-n)/\sqrt n$ converges to $2\sqrt b$ as $n\to \infty$. This proves 
$$
\limsup_{n\to\infty}\frac{x_{n+1}-x_n}{\sqrt{x_n}} = 2\sqrt b,
$$
as required. So the proof is complete.
\end{proof}
\begin{corollary}\label{cor17c2sqrtb}
Let $b$ be an integer not less than $2$ and $c=2\sqrt b$. Then for each $n\in \mathbb N$, the interval $(n,n+c\sqrt n]$ always contains a $b$-adic antipalindrome of type 2 (free middle type). This is best possible in the sense that if $\varepsilon>0$ is given, then there are infinitely many $n\in \mathbb N$ such that the interval $(n,n+(c-\varepsilon)\sqrt n]$ does not contain a $b$-adic antipalindrome of type 2.
\end{corollary}
\begin{proof}
We apply Theorem \ref{thm7anti} and an argument similar to Corollary \ref{cor3(n,n+csqrtn-1} to obtain this corollary. 
\end{proof}
\begin{theorem}\label{cin[1,4]thm8}
Let $b$ be an integer not less than $2$ and $(x_n)$ the strictly increasing sequence of $b$-adic antipalindromes of type 0 (no middle type). Then $x_{n+1} - x_n < c_n(b-1)x_n$ for all $n\in \mathbb N$, where
\begin{equation}\label{cneq}
c_n = 1+\frac{2b}{\left(b-1\right)\left(\sqrt{n+1}-1\right)}.
\end{equation}
In addition, we have
$$
\limsup_{n\to\infty} \frac{x_{n+1}-x_n}{x_n} = b-1.
$$
\end{theorem}
\begin{proof}
Since type 0 is similar to type 2, we can slightly modify the proof of Theorem \ref{thm7anti} to  obtain a proof of this theorem. In fact, types 0 and 2 are the same when the number of digits $k+1$ is even. In this proof, unless stated otherwise, $b$-adic antipalindromes are of type 0. Let $n\geq b$ and let $n=(n_kn_{k-1}\cdots n_0)_b$ be a $b$-adic antipalindrome with $n_k\neq 0$. Let $m=f_0(n)$. By the definition of type 0, we obtain that $k$ is odd. So the three cases of even integer $k$ in Theorem \ref{thm7anti} do not occur in this proof. In addition, it is straightforward to check that if $b\leq n\leq b^3$, then $n\leq (b-1)b$ and 
\begin{align*}
\frac{m-n}{n} &\leq \max\left\{ \frac{b-1}{b+(b-2)},\ \frac{b^3+(b-2)}{(b-1)b} \right\} = \frac{b^2+b+2}{b}\\
&= (b-1)\left( 1+\frac{2(b+1)}{(b-1)b} \right)< c_n(b-1).
\end{align*}
So we assume that $n\geq b^3+1$. So $k\geq 3$. Furthermore, if $n_{\frac{k+1}{2}}\neq b-1$, then we can use exactly the same calculation as in Case 1 of Theorem \ref{thm7anti} to obtain 
\begin{equation}\label{thm8type0eq1}
m-n \leq \left(\sqrt b-\sqrt{b^{-1}}\right)\sqrt n < (b-1)c_nn.
\end{equation}
So it remains to consider the results corresponding to Cases 5 and 6 in Theorem \ref{thm7anti}. 

\bigskip\noindent
\textbf{Case 1:} $k$ is odd, $n_{\frac{k+1}{2}} = b-1$, and $n_i\neq b-1$ for some $i > \frac{k+1}{2}$. This is the same as in Case 6 in Theorem \ref{thm7anti} and the same calculation still work. Therefore 
\begin{equation}\label{thm8type0eq2}
m-n \leq 2\sqrt b\sqrt n < (b-1)c_nn.
\end{equation}  

\bigskip\noindent
\textbf{Case 2:} $k$ is odd and $n_i = b-1$ for all $i\geq \frac{k+1}{2}$. This is similar to Case 5 in Theorem \ref{thm7anti}. We have $n = b^{k+1}-b^{\frac{k+1}{2}}$ and $f_2(n) = b^{k+1}+b^{\frac{k+1}{2}}-2$. By Lemma \ref{lemma3.5f(n)}, we obtain $f_0(n)\geq f_2(n)\geq b^{k+1}$. Since $k+1$ is even, the integers in the interval $\left[b^{k+1},b^{k+2}\right)$ are not  $b$-adic antipalindromes of type 0. So $f_0(n)\geq b^{k+2}$. Since $k+2$ is odd, types 0 and 2 are the same in the interval $\left[b^{k+2},b^{k+3}\right)$. Therefore the smallest $b$-adic antipalindrome of types 0 and 2 that is larger than $b^{k+2}$ is the same too. Thus 
$$
m = f_0(n) = f_2\left(b^{k+2}\right) = b^{k+2}+b^{\frac{k+3}{2}}-2.
$$
Since $n<b^{k+1}-1$, we have 
\begin{align}
\frac{m-n}{n} &= \frac{b^{k+2}-b^{k+1}}{b^{k+1}-b^{\frac{k+1}{2}}} + \frac{b^{\frac{k+3}{2}}+b^{\frac{k+1}{2}}}{b^{k+1}-b^{\frac{k+1}{2}}}-\frac{2}{b^{k+1}-b^{\frac{k+1}{2}}}\notag\\
&= (b-1)\left(1+\frac{1}{b^{\frac{k+1}{2}}-1}+\frac{b+1}{(b-1)\left(b^{\frac{k+1}{2}}-1\right)}\right)-\frac{2}{b^{k+1}-b^{\frac{k+1}{2}}} \label{thm8type0eq4}\\
&< (b-1)\left(1+\frac{2b}{\left(b-1\right)\left(b^{\frac{k+1}{2}}-1\right)}\right)\notag\\
&< (b-1)\left(1+\frac{2b}{\left(b-1\right)\left(\sqrt{n+1}-1\right)}\right)
= (b-1)c_n.\notag
\end{align}
This proves $x_{n+1}-x_n < (b-1)c_n x_n$ for all $n\geq 1$. Then it also follows that the limit supremum of $(x_{n+1}-x_n)/x_n$ is less than or equal to $b-1$.  Furthermore, we obtain from \eqref{thm8type0eq4} that $(m-n)/n$ converges to $b-1$ as $k\to\infty$. This proves the remaining parts of this theorem.  
\end{proof}
\begin{corollary}\label{cin[1,4]cor8.5}
Let $b$ be an integer not less than $2$. If a positive real number $\varepsilon$ is given, then the interval $(n,(b+\varepsilon)n)$ contains a $b$-adic antipalindrome of type 0 (no middle type) for all large $n$, and there are infinitely many $m\in \mathbb N$ such that the interval $(m,(b-\varepsilon)m]$ does not contain a $b$-adic antipalindrome of type 0.  
\end{corollary}
\begin{proof}
This follows immediately from the limit supremum in Theorem \ref{cin[1,4]thm8}.
\end{proof}

If $b$ is even, then the equality $2n_{\frac k2} = b-1$ is not possible, and so types 0 and 1 are equivalent. If $b$ is odd, then type 1 is a bit different from types 0 and 2 as shown in the next theorem.
\begin{theorem}\label{type1thm9}
Let $b$ be an integer not less than $2$ and $(x_n)$ the strictly increasing sequence of $b$-adic antipalindromes of type 1 (one middle type). Then the following statements hold.
\begin{itemize}
\item[{\rm(i)}] If $b$ is even, then $x_{n+1}-x_n < (b-1)c_n x_n$ for all $n\in \mathbb N$, and
$$
\limsup_{n\to\infty}\frac{x_{n+1}-x_n}{x_n} = b-1,
$$
where $c_n$ is defined as \eqref{cneq}.
\item[{\rm(ii)}] If $b$ is odd, then $x_{n+1}-x_n \leq (b+1)\sqrt{x_n}$ for all $n\in \mathbb N$, and
$$
\limsup_{n\to\infty}\frac{x_{n+1}-x_n}{\sqrt{x_n}} = b+1.
$$
\end{itemize}
\end{theorem}
\begin{proof}
The statement (i) follows immediately from Theorem \ref{cin[1,4]thm8}. So we only need to prove (ii). In this proof, unless stated otherwise, all $b$-adic antipalindromes are of type 1. Assume that $b$ is odd, $n$ is a $b$-adic antipalindrome represented as $n= (n_kn_{k-1}\cdots n_0)_b$ with $n_k\neq 0$, and $m = f_1(n)$. By listing all $b$-adic antipalindromes in $[1,b^3)$, it is straightforward to check that if $n\leq b^3$, then $m-n \leq (b+1)\sqrt n$. So assume that $n\geq b^3$. Therefore $k\geq 3$. If $k$ is even, then $n_{\frac k2} = \frac{b-1}{2}\neq b-1$. So Cases 3 and 4 in the proof of Theorem  \ref{thm7anti} do not occur here, but we cannot simply follow Case 2 in Theorem \ref{thm7anti} because when $k$ is even, the middle digits of $m$ and $n$ are fixed to be $\frac{b-1}{2}$. We still need to split the calculation into 5 cases as follows.

\bigskip\noindent
\textbf{Case 1:} $k$ is even and $n_i\neq b-1$ for some $i>\frac k2$. Then $n_i\neq 0$ for some $i<\frac k2$. Let $j$ be the largest integer less than $\frac k2$ such that $n_j\neq 0$. Then $n_{k-j}\neq b-1$. Let $y = b^{\frac k2+1}+b^{\frac k2}-b^{j+1}-b^j$. Then $n+y$ is a $b$-adic antipalindrome. Therefore
\begin{equation}\label{Case1thm9eq1}
m-n\leq y < b^{\frac k2+1}+b^{\frac k2} = (b+1)b^{\frac k2} < (b+1)\sqrt n.
\end{equation} 

\bigskip\noindent
\textbf{Case 2:} $k$ is even and $n_i=b-1$ for all $i>\frac k2$. Then $n_i = 0$ for all $i<\frac k2$. Then $n = b^{k+1}-b^{\frac k2+1}+\left(\frac{b-1}{2}\right)b^{\frac k2}$. Let 
\begin{align*}
y &= b^{\frac k2+1}+\left(\frac{b+1}{2}\right)b^{\frac k2}-2\\
&=b^{\frac k2+1}+\left(\frac{b-1}{2}\right)b^{\frac k2}+(b-1)\sum_{0<i<\frac k2}b^i+(b-2).
\end{align*}
Then $n+y$ is a $b$-adic antipalindrome. Recall that $k\geq 3$ and $k$ is even. So $k\geq 4$. Moreover, $b\geq 3$ since $b\geq 2$ and $b$ is odd. Therefore
$$
\frac{m-n}{\sqrt n} \leq \frac{y}{\sqrt n} < \frac{2b^{\frac k2+1}}{\sqrt{b^{k+1}-b^{\frac k2+1}}} = \frac{2\sqrt b}{\sqrt{1-b^{-\frac k2}}} \leq \frac{2\sqrt b}{\sqrt{1-b^{-2}}} < b+1.
$$
So we have $m-n<(b+1)\sqrt n$.

\bigskip\noindent
\textbf{Case 3:} $k$ is odd and $n_{\frac{k+1}{2}}\neq b-1$. Then we follow Case 1 of Theorem \ref{thm7anti} to obtain 
$$
m-n \leq (\sqrt b-\sqrt{b^{-1}})\sqrt n \leq (b+1)\sqrt n.
$$

\bigskip\noindent
\textbf{Case 4:} $k$ is odd, $n_{\frac{k+1}{2}} = b-1$, and $n_i\neq b-1$ for some $i>\frac{k+1}{2}$. This is the same as Case 6 of Theorem \ref{thm7anti} and the same calculation still works. Therefore
$$
m-n < 2\sqrt b\sqrt n \leq (b+1)\sqrt n.
$$

\bigskip\noindent
\textbf{Case 5:} $k$ is odd and $n_i = b-1$ for all $i\geq \frac{k+1}{2}$. This is similar to Case 5 in Theorem \ref{thm7anti} and Case 2 in Theorem \ref{cin[1,4]thm8}. Then $n = b^{k+1}-b^{\frac{k+1}{2}}$ and $f_2(n) = b^{k+1}+b^{\frac{k+1}{2}}-2$. By Lemma \ref{lemma3.5f(n)}, we have $f_1(n)\geq f_2(n)\geq b^{k+1}$. Since $k+1$ is even, the $b$-adic antipalindromes of type 1 in the interval $\left[b^{k+1},b^{k+2}\right)$ have their middle digit (the digit corresponding to $b^{\frac{k+1}{2}}$) equal to $\frac{b-1}{2}$. Since $f_2(n)$ is a $b$-adic antipalindrome of type 2 having middle digit equal to $0$ and $f_1(n)>f_2(n)$, we see that $m = f_1(n) = f_2(n)+\left(\frac{b-1}{2}\right)b^{\frac{k+1}{2}}$.  Therefore
\begin{align}\label{thm9eq2}
\frac{m-n}{\sqrt n} &= \frac{\left(\frac{b+3}{2}\right)b^{\frac{k+1}{2}}-2}{\sqrt{b^{k+1}-b^{\frac{k+1}{2}}}} < \frac{b+3}{2\sqrt{1-b^{-\frac{k+1}{2}}}}\\
&\leq \frac{b+3}{2\sqrt{1-b^{-2}}} < b+1.\notag
\end{align}
From Cases 1--5, we obtain $x_{n+1}-x_n \leq (b+1)\sqrt{x_n}$ for all $n\geq 1$. For the limit supremum, we construct the integers $n$ as in Case 1 where $k\geq 10$, $k$ is even, $j = \left\lfloor k/3\right\rfloor$, and
$$
n = b^k+b^{k-j}-b^{\frac k2+1}+\left(\frac{b-1}{2}\right)b^{\frac k2}+b^{j+1}-2.
$$ 
By Lemma \ref{lemma3.5f(n)}, we obtain $m = n+y$ where $y = b^{\frac k2+1}+b^{\frac k2}-b^{j+1}-b^j$. It is easy to verify that $y/\sqrt n$ converges to $b+1$ as $k\to\infty$. Therefore $(m-n)/\sqrt n$ converges to $b+1$ as $n\to \infty$. This proves the remaining part of this theorem.
\end{proof}
\begin{corollary}\label{cor21fromcor19}
If $b\geq 2$ and $b$ is even, then type 0 (no middle type) in Corollary \ref{cin[1,4]cor8.5} can be replaced by type 1 (one middle type), and the same result holds. If $b\geq 3$, $b$ is odd, and $\varepsilon>0$, then the interval $(n,n+(b+1)\sqrt n]$ contains a $b$-adic antipalindrome of type 1 for all $n\geq b$, and there are infinitely many $m\in \mathbb N$ such that the interval $(m,m+(b+1-\varepsilon)\sqrt m]$ does not contain a $b$-adic antipalindrome of type 1.
\end{corollary}
\begin{proof}
This follows immediately from the limit supremum in Theorem \ref{type1thm9}.
\end{proof}
\subsection{Antipalindromes of type 3 in short intervals}

Recall that the antipalindromes of type 3 (asymmetric type) are those with the property $n_{k-i}\neq n_i$ for $0\leq i\leq \left\lfloor (k-1)/2\right\rfloor$. We begin with a lemma on $f_3(n)$ as follows.
\begin{lemma}\label{lemmaAtype3}
Let $b$ be an integer not less than $3$. Then the following statements hold.
\begin{itemize}
\item[{\rm(i)}] If $k\geq 1$ and $n = b^{k+1}-1-\frac{b^{\left\lceil \frac k2\right\rceil}-1}{b-1}$, then 
\begin{equation}\label{lemmaAtype3eq1}
f_3(n) = b^{k+1}+\frac{b^{\left\lceil \frac{k+1}{2}\right\rceil}-1}{b-1}-1.
\end{equation}
\item[{\rm(ii)}] If $k$ is odd, $k\geq 11$, $j=\left\lfloor k/3\right\rfloor$, and $n = b^k+b^{k-j}-\frac{b^{\frac{k+1}{2}}-b^{j+1}}{b-1}-1$, then 
\begin{equation}\label{lemmaAtype3eq2}
f_3(n) = b^k+b^{k-j}+\frac{b^{\frac{k+1}{2}}-b^{j+1}}{b-1}+\frac{b^j-b}{b-1}.
\end{equation}
\end{itemize}
\end{lemma}
\begin{proof}
Let $n$ be defined as in (i) and let $m$ be the number on the right-hand side of \eqref{lemmaAtype3eq1}. Then 
\begin{align*}
n &= (b-1)\sum_{\left\lceil \frac k2\right\rceil\leq i\leq k}b^i+(b-2)\sum_{0\leq i < \left\lceil \frac k2\right\rceil}b^i\quad\text{and}\\
m &= b^{k+1}+\sum_{0 < i < \left\lceil \frac{k+1}{2}\right\rceil}b^i.
\end{align*}
Let $y = (y_ky_{k-1}\cdots y_0)_b$ and $n<y\leq b^{k+1}-1$. By comparing the digits of $n$, $y$, and $b^{k+1}-1$, we see that $y_i = b-1$ for $\left\lceil \frac k2\right\rceil\leq i\leq k$ and $y_j = b-1$ for some $j < \left\lceil \frac k2\right\rceil$. This implies that $y_j = y_{k-j}$, and so $y$ is not a $b$-adic antipalindrome of type 3. This shows that there is no $b$-adic antipalindrome of type 3 in the interval $\left(n,b^{k+1}\right)$. In addition, the integer $b^{k+1}$ is not a $b$-adic antipalindrome of type $3$. Therefore $f_3(n)>b^{k+1}$. It is easy to see that $m$ is a $b$-adic antipalindrome of type 3 larger than $n$. Thus $b^{k+1}<f_3(n)\leq m$. Next, let $z = (z_{k+1}z_k\cdots z_0)_b$ and $b^{k+1}<z<m$. Then $z_{k+1} = 1$ and $z_i = 0$ for $\left\lceil \frac{k+1}{2}\right\rceil\leq i\leq k$. If $z_i\neq 0$ for every $i\in \left(0,\left\lceil \frac{k+1}{2}\right\rceil\right)$, then $z_i = 1$ for all $i\in \left(0,\left\lceil \frac{k+1}{2}\right\rceil\right)$, which implies $z\geq m$, a contradiction. Therefore $z_j = 0$ for some $j\in \left(0,\left\lceil \frac{k+1}{2}\right\rceil\right)$. So $z_j = z_{k+1-j}$ and $z$ is not a $b$-adic antipalindrome of type 3. This implies that $f_3(n)\geq m$. Hence $f_3(n)=m$, as required.

Next, we prove (ii). So let $n$ be defined as in (ii) and let $m$ be the number on the right-hand side of \eqref{lemmaAtype3eq2}. Then 
\begin{align*}
n &= b^k+(b-1)\sum_{\frac{k+1}{2}\leq i<k-j}b^i+(b-2)\sum_{j<i<\frac{k+1}{2}}b^i+(b-1)\sum_{0\leq i\leq j}b^i,\\
n+\sum_{j<i<\frac{k+1}{2}}b^i &= b^k+b^{k-j}-1, \quad\text{and}\\
m &= b^k+b^{k-j}+\sum_{j<i<\frac{k+1}{2}}b^i+\sum_{0< i< j}b^i.
\end{align*} 
Let $y = (y_ky_{k-1}\cdots y_0)_b$. Suppose that $n<y\leq b^k+b^{k-j}-1$. Then $y_i=n_i$ for $\frac{k+1}{2}\leq i\leq k$. If $y_i\neq b-1$ for every $i\in \left(j,\frac{k+1}{2}\right)$, then $y_i = b-2$ for all $i\in \left(j,\frac{k+1}{2}\right)$, which implies $y=n$, a contradiction. Therefore $y_i = b-1$ for some $i\in \left(j,\frac{k+1}{2}\right)$. Then $y_i = y_{k-i}$ and so $y$ is not a $b$-adic antipalindrome of type 3. This shows that there is no $b$-adic antipalindrome of type 3 in the interval $\left(n,b^k+b^{k-j}-1\right]$. It is easy to check that $m$ is a $b$-adic antipalindrome of type 3 larger than $n$. Therefore 
$$
b^k+b^{k-j}\leq f_3(n)\leq m.
$$ 
Suppose $b^k+b^{k-j} \leq y<m$. We will show that $y$ is not a $b$-adic antipalindrome of type 3. We have $y_i = m_i$ for all $i\in \left[\frac{k+1}{2},k\right]$. If $y_i = 0$ for some $i\in \left(j,\frac{k+1}{2}\right)$, then $y_i = y_{k-i}$ and we are done. So we can assume that $y_i = 1$ for all $i\in \left(j,\frac{k+1}{2}\right)$. Then $y_j = 0$. If $y_i\neq 0$ for every $i\in (0,j)$, then $y_i = 1$ for all $i\in(0,j)$, which implies $y\geq m$, a contradiction. So $y_i = 0$ for some $i\in (0,j)$. Thus $y_i=y_{k-i}$ and $y$ is not a $b$-adic antipalindrome of type 3. This shows that there is no $b$-adic antipalindrome of type 3 in the interval $\left[b^k+b^{k-j},m\right)$. Hence $f_3(n)=m$, and the proof is complete.
\end{proof}
\begin{remark}\label{remarkAtype3}
If $b=2$, then the $b$-adic antipalindromes of types 2 and 3 are the same. The constants $2\sqrt b$ in Theorem \ref{thm7anti} and $\frac{2\sqrt b}{b-1}$ in Theorem \ref{thm16maintype3} are also the same when $b=2$. So we do not need to give a proof of Theorem \ref{thm16maintype3} when $b=2$.
\end{remark}
\begin{theorem}\label{thm16maintype3}
Let $b$ be an integer not less than $2$, $c = \frac{2\sqrt b}{b-1}$, and $(x_n)$ the strictly increasing sequence of $b$-adic antipalindromes of type 3 (asymmetric type). Then $x_{n+1}-x_n\leq c\sqrt{x_n}$ for all $n\geq b$ and 
$$
\limsup_{n\to\infty}\frac{x_{n+1}-x_n}{\sqrt{x_n}} = c.
$$
\end{theorem}
\begin{proof}
By Remark \ref{remarkAtype3}, we can assume that $b\geq 3$. Unless stated otherwise, all $b$-adic antipalindromes in this proof are of type 3. Let $n$ be a $b$-adic antipalindrome represented as $n= (n_kn_{k-1}\cdots n_0)_b$, where $n_k\neq 0$. Let $m$ be the smallest $b$-adic antipalindrome larger than $n$. By listing all $b$-adic antipalindromes less than $b^3$, it is straightforward to check that if $b\leq n<b^3$, then $m-n\leq c\sqrt n$. So we can assume that $n\geq b^3$, and so $k\geq 3$. Before proceeding further, we first give the following observation that will be used throughout the proof:
\begin{itemize}
\item[(A1)] If there exists an integer $i\leq\left\lfloor \frac{k-1}{2} \right\rfloor$ such that $n_i\neq b-1$ and $n_i+1\neq n_{k-i}$, then $m-n < c\sqrt n$.
\item[(A2)] If there is an integer $i\leq \left\lfloor \frac{k-1}{2} \right\rfloor$ such that $n_i\leq b-3$, then $m-n < c\sqrt n$.
\item[(A3)] If $k$ is odd and $n_{\frac{k-1}{2}} = b-1$, then $m-n < c\sqrt n$.
\end{itemize} 
To prove (A1), we only need to observe that if the condition in (A1) is satisfied, then $n+b^i$ is a $b$-adic antipalindrome, and therefore
$$
\frac{m-n}{\sqrt n}\leq \frac{b^i}{\sqrt n} \leq \frac{b^{\left\lfloor \frac{k-1}{2} \right\rfloor}}{b^{\frac k2}} \leq \frac{1}{\sqrt b} < c.
$$
Next, if the condition in (A2) is satisfied, then $n+b^i$ or $n+2b^i$ is a $b$-adic antipalindrome, and so 
$$
\frac{m-n}{\sqrt n}\leq \frac{2b^i}{\sqrt n} \leq \frac{2b^{\left\lfloor \frac{k-1}{2}\right\rfloor}}{b^{\frac k2}} \leq \frac{2}{\sqrt b} < c.
$$
Finally, suppose that the condition in (A3) is satisfied. Then $n_{\frac{k+1}{2}}\neq b-1$. So $n+b^{\frac{k-1}{2}}$ is a $b$-adic antipalindrome. Therefore $m-n\leq b^{\frac{k-1}{2}}\leq \sqrt n/\sqrt b < c\sqrt n$.

We now proceed to give a proof of this theorem.

\bigskip\noindent
\textbf{Case 1:} $k$ is odd and $n_i = b-2$ for all $i<\frac{k-1}{2}$. By (A2) and (A3), we can assume that $n_{\frac{k-1}{2}}=b-2$. Then by (A1), we can further assume that $n_i+1 = n_{k-i}$ for all $i\leq \frac{k-1}{2}$. Therefore $n_{k-i} = b-1$ for all $i\leq \frac{k-1}{2}$. By Lemma \ref{lemmaAtype3}, we obtain $m = b^{k+1}+\frac{b^{\frac{k+1}{2}}-1}{b-1}-1$. In addition, we have $n\geq b^{k+1}-b^{\frac{k+1}{2}}$. Therefore
\begin{align*}
\frac{m-n}{\sqrt n} &= \frac{2}{b-1}\left(\frac{b^{\frac{k+1}{2}}-1}{\sqrt n}\right) < \frac{2}{b-1}\left(\frac{b^{\frac{k+1}{2}}}{\sqrt{b^{k+1}-b^{\frac{k+1}{2}}}}\right)\\
&= \frac{2}{b-1}\left(\frac{1}{\sqrt{1-b^{-\frac{k+1}{2}}}}\right)\leq \frac{2}{b-1}\left(\frac{1}{\sqrt{1-b^{-1}}}\right)<c.
\end{align*}

\bigskip\noindent
\textbf{Case 2:} $k$ is odd and $n_i\neq b-2$ for some $i<\frac{k-1}{2}$. Similar to Case 1, by applying (A2) and (A3), we can assume that $n_{\frac{k-1}{2}}= b-2$ and $n_i\in \{b-2,b-1\}$ for all $i<\frac{k-1}{2}$. By (A1), we can also assume that 
\begin{equation}\label{type3eq1}
\text{if $i\leq \frac{k-1}{2}$ and $n_i\neq b-1$, then $n_i+1 = n_{k-i}$.}
\end{equation}
So, in particular, $n_{\frac{k+1}{2}} = b-1$, and for $0\leq i<\frac{k-1}{2}$, we have $n_i = b-2$ if and only if $n_{k-i} = b-1$. If $n_i = b-1$ for all $i>\frac{k+1}{2}$, then $n_i = b-2$ for all $i\leq \frac{k-1}{2}$, which is not the case we are considering. So $n_i\neq b-1$ for some $i>\frac{k+1}{2}$. For convenience, let $i_0$ be the smallest integer larger than $\frac{k+1}{2}$ such that $n_{i_0}\neq b-1$ and write $i_0 = k-j$ where $j < \frac{k-1}{2}$. Then $n_i = b-2$ and $n_{k-i} = b-1$ for all $i\in \left(j,\frac{k-1}{2}\right]$. Let $y_0 = b-n_0$ and $y_i = b-1-n_i$ for $0<i\leq \frac{k-1}{2}$. In addition, let $z_0=z_j=0$, $z_i=1$ for $j<i\leq\frac{k-1}{2}$, and $z_i = \max\{0,1-n_{k-i}\}$ for $0<i<j$. Then for $i\in \left(0,j\right)$, we have $z_i\in \{0,1\}$, $z_i = 0$ if and only if $n_{k-i}\neq 0$, and $z_i = 1$ if and only if $n_{k-i}=0$. Let 
$$
y = \sum_{0\leq i\leq \frac{k-1}{2}}y_ib^i\;\text{and}\; z = \sum_{0\leq i\leq \frac{k-1}{2}}z_ib^i.
$$
Then 
\begin{align*}
n+y &= \sum_{k-j<i\leq k}n_ib^i+(n_{k-j}+1)b^{k-j},\\
n+y+z &= \sum_{k-j<i\leq k}n_ib^i+(n_{k-j}+1)b^{k-j}+\sum_{j<i\leq \frac{k-1}{2}}b^i+\sum_{0<i<j}z_ib^i.
\end{align*}
Then $n+y+z$ is a $b$-adic antipalindrome, and so $m-n\leq y+z$. Since $n_i\in \{b-1, b-2\}$ for all $i\in \left[0,\frac{k-1}{2}\right]$, we see that $y_0\leq 2$ and $y_i\leq 1$ for all $i\in \left(0,\frac{k-1}{2}\right]$. In addition, we have $z_0 = 0$ and $z_i\leq 1$ for all $i\in \left(0,\frac{k-1}{2}\right]$. Therefore $y_i+z_i \leq 2$ for all $i\in \left[0,\frac{k-1}{2}\right]$. Hence 
$$
m-n \leq y+z\leq 2\sum_{0\leq i\leq \frac{k-1}{2}}b^i= \frac{2}{b-1}\left(b^{\frac{k+1}{2}}-1\right)<\frac{2b^{\frac{k+1}{2}}}{b-1} \leq c\sqrt n.
$$

\bigskip\noindent
\textbf{Case 3:} $k$ is even and $n_i = b-2$ for all $i<\frac k2$. By (A1), we can assume that $n_{k-i} = b-1$ for all $i<\frac k2$. If $n_{\frac k2}\neq b-1$, then $n+1+\sum_{0\leq i<\frac k2}b^i$ is a $b$-adic antipalindrome, and therefore
$$
\frac{m-n}{\sqrt n} \leq \frac{1+\sum_{0\leq i<\frac k2}b^i}{\sqrt n} \leq \frac{1+\frac{b^{\frac k2}-1}{b-1}}{b^{\frac k2}} < \frac{1}{b^{\frac k2}}+\frac{1}{b-1} < c.
$$
So we can assume that $n_{\frac k2} = b-1$. Then $n = b^{k+1}-1-\frac{b^{\frac k2}-1}{b-1}$ which is in the form suitable for the application of Lemma \ref{lemmaAtype3}. Therefore 
$$
m = b^{k+1}+\frac{b^{\frac{k+2}{2}}-1}{b-1} -1,
$$
and so 
\begin{align*}
\frac{m-n}{\sqrt n} &= \frac{b^{\frac{k+2}{2}}+b^{\frac k2}-2}{(b-1)\sqrt n} < \frac{b^{\frac{k+2}{2}}+b^{\frac k2}}{(b-1)\sqrt{b^{k+1}-b^{\frac k2}}}\\
&= \frac{\sqrt b+\sqrt{b^{-1}}}{(b-1)\sqrt{1-b^{-\frac{k+2}{2}}}} \leq \frac{\sqrt b+\sqrt{b^{-1}}}{(b-1)\sqrt{1-b^{-3}}} < c.
\end{align*}

\bigskip\noindent
\textbf{Case 4:} $k$ is even and $n_i\neq b-2$ for some $i<\frac k2$. By (A1) and (A2), for all $i<\frac k2$, we can assume that $n_i\in \{b-2,b-1\}$ and that $n_i = b-2$ if and only if $n_{k-i}=b-1$.

\bigskip\noindent
\textbf{Case 4.1:} $n_{\frac k2}\neq b-1$. We will define $y$ and $z$ similar to those in Case 2. Let $y_0 = b-n_0$ and $y_i = b-1-n_i$ for $0<i<\frac k2$. In addition, let $z_0 = 0$ and $z_i = \max\{0,1-n_{k-i}\}$ for $0<i<\frac k2$. Then $z_i = 0$ if and only if $n_{k-i}\neq 0$, and $z_i = 1$ if and only if $n_{k-i} = 0$. Let 
$$
y = \sum_{0\leq i<\frac k2}y_ib^i \quad\text{and}\quad z = \sum_{0\leq i<\frac k2}z_ib^i.
$$
Similar to Case 2, we obtain that $n+y+z$ is a $b$-adic antipalindrome, and $y_i+z_i \leq 2$ for all $i<\frac k2$. Therefore
$$
\frac{m-n}{\sqrt n} \leq \frac{y+z}{\sqrt n} \leq \frac{2\left(\frac{b^{\frac k2}-1}{b-1}\right)}{b^{\frac k2}} < \frac{2}{b-1} < c.
$$ 

\bigskip\noindent
\textbf{Case 4.2:} $n_{\frac k2} = b-1$. Similar to Case 2, there exists $i>\frac k2$ such that $n_i\neq b-1$, and  we write $k-j$ for the smallest integer larger than $\frac k2$ such that $n_{k-j}\neq b-1$ where $j<\frac k2$. Then $n_i = b-2$ and $n_{k-i} = b-1$ for all $i\in \left(j,\frac k2\right)$. Let $y_0 = b-n_0$ and $y_i = b-1-n_i$ for $0<i<\frac k2$. In addition, let $z_0 = z_j = 0$, $z_i = 1$ for $j<i<\frac k2$, and $z_i = \max\{0,1-n_{k-i}\}$ for $0<i<j$. Then similar to Case 2, we obtain $n+y+z$ is a $b$-adic antipalindrome and $y_i+z_i\leq 2$ for all $i<\frac k2$. Therefore
$$
\frac{m-n}{\sqrt n}\leq \frac{y+z}{\sqrt n} \leq \frac{2\left(\frac{b^{\frac k2}-1}{b-1}\right)}{b^\frac k2}<\frac{2}{b-1} < c.
$$
From the calculation in all cases, we conclude that $x_{n+1}-x_n \leq c\sqrt n$ for all $n\geq b$. For the limit supremum, we let $n$ be defined as in (ii) of Lemma \ref{lemmaAtype3}, where $k\geq 11$, $k$ is odd, and $j = \left\lfloor k/3\right\rfloor$. Then 
$$
m = f_3(n) = b^k+b^{k-j}+\frac{b^{\frac{k+1}{2}}-b^{j+1}}{b-1}+\frac{b^j-b}{b-1}.
$$
Therefore
\begin{align*}
\frac{m-n}{\sqrt n} &= \frac{1}{\sqrt n}\left(\frac{2}{b-1}\left(b^{\frac{k+1}{2}}-b^{j+1}\right)+\frac{b^j-b}{b-1}+1\right)\\
&= \frac{\frac{2}{b-1}\left(\sqrt b-b^{j+1-\frac k2}\right)+\frac{1}{b-1}\left(b^{j-\frac k2}-b^{1-\frac k2}\right)+b^{-\frac k2}}{\sqrt{1+b^{-j}-\frac{b^{\frac{1-k}{2}}}{b-1}+\frac{b^{j+1-k}}{b-1}-b^{-k}}},
\end{align*}
which converges to $c$ as $k\to \infty$. This completes the proof.
\end{proof}
\section{Comments and questions}
Let $\mathcal{P}_b$ be the set of all $b$-adic palindromes. In this paper, we determine all  integers $d$ such that $R(b;d)$ is infinite, where $R(b;d)$ is defined in \eqref{Req}. Instead of the infinitude of $R(b;d)$, it is also interesting to consider an integer $d$ satisfying $R(b;d)\neq \emptyset$. Recall that for each $X\subseteq \mathbb{R}$, we define the difference set $D(X)$ as $D(X)=\{x-y \mid x,y\in X\}$. Then for each $d\in \mathbb{N}$, the set $R(b;d)$ is not empty if and only if $d \in D(\mathcal{P}_b)$. So we propose the following questions.

\begin{question}
For each $k\in \mathbb N$, does $D(\mathcal{P}_b)$ contain an arithmetic progression of length $k$?  Does $D(\mathcal{P}_b)$ have positive upper asymptotic density? That is, does 
\[
\limsup_{N\to\infty}  \frac{\#(D(\mathcal{P}_b)\cap[-N,N])}{2N+1} >0\;\text{hold}? 
\]
Does $D(\mathcal{P}_b)$ contain infinite arithmetic progressions?
\end{question}

\begin{question}
Let $r(d)$ be the number of $x,y\in P_b$ satisfying $d=x-y$. Is there an asymptotic formula of $\sum_{|d|\leq x,\ r(d)<\infty } r(d)$? For every $d\in \mathbb{Z}$ with $r(d)<\infty$, can we find some upper or lower bounds for $r(d)$? 
\end{question}

Let $S$ be the set of all perfect squares. Let $r$ be a positive integer, and let $S=C_1 \cup \dots \cup C_r$. It is unknown whether or not there exists an arithmetic progression of length $3$ in $C_i$ for some $i = 1,2,\ldots, r$. We are interested in the gaps and other analogous results between squares and palindromes. Thus we would like to consider the following question.

\begin{question}
For each positive integer $r$, if $\mathcal{P}_b=C_1\cup \cdots \cup C_r$, then does some $C_i$ contain an arithmetic progression of length $3$? More generally, for every $A\subseteq \mathcal{P}_b$ with positive upper relative density, that is 
\[
\limsup_{N\to\infty} \frac{\#(A\cap[1,N]) }{\#(\mathcal{P}_b\cap [1,N]) }>0,
\] 
must $A$ contain an arithmetic progression of length $3$?
\end{question}



\section{Acknowledgments}
We would like to thank Yuuya Yoshida for asking us a question concerning
palindromes in short intervals and giving a comment for improving
Theorem \ref{cin[1,4]thm8}.  The referee carefully read our manuscript and gave
us many comments and suggestions that greatly improved the presentation
of this article.

Prapanpong Pongsriiam's research project is supported jointly by the Faculty of Science Silpakorn University and the National Research Council of Thailand (NRCT), grant number NRCT5-RSA63021-02. He was also supported by the Tosio Kato Fellowship given by the Mathematical Society of Japan during his visit at Nagoya University in July 2022 to July 2023. This work was started when he was in Japan and finished when he came back to Thailand. He is thankful to Professor Kohji Matsumoto for being his host professor and finding a very convenient and comfortable accommodation and office for him during his visit at Nagoya University. 

Kota Saito is supported by JSPS KAKENHI Grant Number JP22J00025 and JP22KJ0375. 



\begin{thebibliography}{99}
\bibitem{AJS} G. E. Andrews, M. Just, and G. Simay, Anti-palindromic compositions, {\it Fibonacci Quart.} \textbf{60}(2) (2022), 164--176.

\bibitem{BMRS} J. H. Bai, J. Meleshko, S. Riasat, and J. Shallit, Quotient of palindromic and antipalindromic numbers, {\it Integers} \textbf{22} (2022), Article \#A96.

\bibitem{Borwein} P. B. Borwein, On the irrationality of certain series, {\it Math. Proc. Camb. Phil. Soc.} \textbf{112} (1992), 141--146.

\bibitem{Brun} V. Brun, La s\'{e}rie $1/5+1/7+1/11+1/13+1/17+1/19+1/29+1/31+1/41+1/43+$ $1/59+1/61+\cdots$, o\`{u} les d\'{e}nominateurs sont \lq nombres premiers jumeaux\rq est convergente ou finie, {\it Bull. Sci. Math. (2)} \textbf{43} (1919), 124--128.

\bibitem{BV} P. Bundschuh  and K. V\"{a}\"{a}n\"{a}nen, Linear independence of $q$-analogues of certain classical constants, {\it Results Math.} \textbf{47} (2005), 33--44.

\bibitem{DKR} L. Dvo\v r\'akov\'a, S. Kruml, and D. Ryzak, Antipalindromic numbers, {\it Acta Polytechnica} \textbf{61}(3) (2021), 428--434.

\bibitem{Hua} J. Huang, Partially palindromic compositions, {\it J. Integer Sequences} \textbf{26} (2023), \href{https://cs.uwaterloo.ca/journals/JIS/VOL26/Huang/huang8.html}{Article 23.4.1}.

\bibitem{refpalin1} P. Napp Phunphayap and P. Pongsriiam, A complete comparison for the number of palindromes in different bases, {\it AIMS Math.} \textbf{8}(4) (2023), 9924--9932.

\bibitem{refpalin2} P. Phunphayap and P. Pongsriiam, Extremal orders and races between palindromes in different bases, {\it AIMS Math.} \textbf{7}(2) (2022), 2237--2254.

\bibitem{refpalin3} P. Phunphayap and P. Pongsriiam, Reciprocal sum of palindromes, {\it J.  Integer Sequences} \textbf{22} (2019), 
\href{https://cs.uwaterloo.ca/journals/JIS/VOL22/Pongsriiam/pong32.html}{Article 19.8.6}.

\bibitem{Pong} P. Pongsriiam, Longest arithmetic progressions of palindromes, {\it J. Number Theory} \textbf{222} (2021), 362--375.

\bibitem{refpalin4} P. Pongsriiam and K. Subwattanachai, Exact formulas for the number of palindromes up to a given positive integer, {\it Int. J. Math. Comput. Sci.} \textbf{14} (2019), 27--46.

\bibitem{Slo} N. J. A. Sloane, The On-Line Encyclopedia of Integer Sequences,
online resource, 2023.   Available at \url{https://oeis.org}.

\bibitem{Tachiya} Y. Tachiya, Irrationality of certain Lambert series, {\it Tokyo J. Math.} \textbf{27}(1) (2004), 75--85.
\end{thebibliography}



\bigskip
\hrule
\bigskip

\noindent 2020 {\it Mathematics Subject Classification}: Primary 11A63; Secondary 11B05, 11J72.

\noindent \emph{Keywords:} palindrome, antipalindrome, gap, digital problem, irrationality.

\bigskip
\hrule
\bigskip

\noindent (Concerned with sequences \seqnum{A002113}, \seqnum{A002385}, 
and \seqnum{A035928}.)

\bigskip
\hrule
\bigskip

\vspace*{+.1in}
\noindent
Received July 19 2023;
revised version received December 6 2023.
Published in {\it Journal of Integer Sequences}, 
December 11 2023.

\bigskip
\hrule
\bigskip

\noindent
Return to
\htmladdnormallink{Journal of Integer Sequences home page}{https://cs.uwaterloo.ca/journals/JIS/}.
\vskip .1in


\end{document}
