\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}{\underline{#1}}}
\usepackage{rotating}
\def\modd#1 #2{#1\ \mbox{\rm (mod}\ #2\mbox{\rm )}}
\newcommand{\comment}[1]{}
\newcommand{\ise}{ize}
\newcommand{\C}{{\mathbb C}}
\newcommand{\E}{{\mathbb E}}
\newcommand{\R}{{\mathbb R}}
\newcommand{\N}{{\mathbb N}}
\newcommand{\Q}{{\mathbb Q}}
\newcommand{\Z}{{\mathbb Z}}
\DeclareMathOperator{\Li}{Li}
\newcommand{\Ei}{{\rm Ei}}
\newcommand{\Eone}{{E_1}}
\newcommand{\oneFone}{{_1\hspace*{-0.1em}F_1}}
\newcommand{\twoFone}{{_2\hspace*{-0.1em}F_1}}
\newcommand{\dup}{\,d}
\newcommand{\raisedot}{\raisebox{2pt}{$.$}}
\newcommand{\raisecomma}{\raisebox{2pt}{$,$}}
\newcommand{\half}{\frac{1}{2}}
\newcommand{\Had}{{\,\odot}}
\renewcommand{\thetable}{\arabic{table}}
\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}
\begin{center}
\vskip 1cm{\LARGE\bf
SanD Primes and Numbers
}
\vskip 1cm
\large
Freeman J. Dyson\\
Institute of Advanced Study\\
Princeton, NJ 08540 \\
USA\\
\href{mailto:dyson@ias.edu}{\tt dyson@ias.edu}\\
\ \\
Norman E. Frankel\\
School of Physics\\
University of Melbourne \\
Victoria 3010 \\
Australia\\
\href{mailto:nef@unimelb.edu}{\tt nef@unimelb.edu.au} \\
\ \\
Anthony J. Guttmann\\
School of Mathematics and Statistics\\
The University of Melbourne\\
Victoria 3010 \\
Australia\\
\href{mailto:guttmann@unimelb.edu.au}{\tt guttmann@unimelb.edu.au}
\end{center}
\vskip .2 in
\begin{abstract}
We define SanD (\underline{S}um and \underline{D}ifference)
numbers as ordered pairs $(p,\, q)$
such that the digital sum $s_{10}(p q)=q-p=\Delta >0$. We
consider both the decimal and the binary cases in detail, and other
bases more superficially. If both $p$ and $q$ are prime numbers, we
refer to SanD {\em primes}. For SanD primes, we prove that, with one
exception, notably the pair $(2,7)$, the differences $\Delta = q-p =
14+18k,\,\,k=0,1,2,\ldots$.
Based on probabilistic arguments, we conjecture that the number of
(base-10) SanD numbers less than $x$ grows like $c_1 x$, where $c_1 = 2/3$,
while the number of (base-10) SanD primes less than $x$ grows like $c_2 x/\log^2{x}$, where $c_2 = 3/4$.
We calculate the number of SanD primes up to $3\cdot 10^{12}$, and use this data to investigate the convergence of estimators of the constant $c_2$ to the calculated value. Due to the quasi-fractal nature of the digital sum function, convergence is both slow and erratic compared to the corresponding calculation for twin primes, though the numerical results are consistent with the calculated results.
\end{abstract}
\vskip .3cm
\section{Introduction}
\label{introduction}
\label{sec1}
In honour of the 95th birthday of one of the authors (FJD), another of the authors (NEF) coined the SanD prime problem.
\underline{S}um and \underline{D}ifference
{\em primes\/} are defined to be the subset of primes $p,q \in \mathtt{PRIMES}$ with the property that $p q=r$, where the sum of the (decimal) digits of $r$, denoted $s_{10}(r)$, is equal to $q-p=\Delta>0$.
There is only one pair involving the prime 2, viz.~$(2,7)$, as $2\cdot 7=14$, and $s_{10}(14)=7-2=5$. The next example is $(5,19)$, as $5 \cdot 19=95$, both 5 and 19 are primes and $s_{10}(95)=14=19-5$.
If we relax the requirement of primality, we refer to SanD {\em numbers}.
Of course the SanD numbers and SanD primes can be defined in terms of the digital sum in any base $b$, though $b$ must be even for there to be a non-empty set of such numbers/primes (see Section \ref{arb}). Here we treat the decimal ($b=10$) and binary ($b=2$) bases in detail, and the general case more superficially. The effect of the digital sum constraint is more prominent in the decimal case.
The study of digital sums goes back at least to Legendre \cite{L98}. In the late 18th century he proved that
\begin{equation}\label{L1}
s_b(n)=n-(b-1)\sum_{j \ge 1} \left\lfloor \frac{n}{b^j} \right\rfloor.
\end{equation}
Because of the irregular nature of this function,
attention historically turned instead to the behaviour of the random variable $s_b(U_n)$, where $U_n$ assumes each of the values $\{0,\ldots,n-1\}$ with equal probability $1/n$. Let $X_n=X_n(b)$ denote the random variable $s_b(U_n)$ just defined. The first asymptotic result was proved by Bush \cite{B40} in 1940, who showed that
$$\mathbb{E}(X_n) \sim \frac{b-1}{2} \log_b{n}.$$
Mirsky \cite{M49} in 1949 showed that the error term in this expression is $O(1)$, a result implicit in Bush's calculation. A significant improvement was made by Delange \cite{D75} who showed that $$\mathbb{E}(X_n)- \frac{b-1}{2} \log_b{n}= F_1(\log_b{n}),$$ where $F_1(x)=F_1(x+1)$ is a continuous, periodic {\em nowhere differentiable\/} function. An elegant derivation of this result using the Mellin-Perron technique can be found in \cite{FGKBT}. An illuminating discussion of the properties of this function is given in \cite{CH14}, as well as an extensive bibliography and discussion of the literature on digital sums. We will not make use of this result, except in the most general sense of referring to the properties of digital sums.
One further result worthy of note is that the ordinary generating function of the digital sum $s_b(n)$ is given by Adams-Walter and Ruskejin \cite{FAR09}, and is
$$\sum_{n \ge 0} s_b(n)z^n = \frac{1}{1-z}\sum_{m \ge 0} \frac{z^{b^m}-bz^{b^{m+1}}+(b-1)z^{(b+1)b^m}}{(1-z^{b^m})(1-z^{b^{{m+1}}})}.$$
In the next section we prove that the definition of SanD numbers and primes restricts the differences $q-p$ to a given subset of the integers. In
Section~\ref{sec3} we study the growth in the number of SanD numbers and primes, and give probabilistic arguments that the number of decimal SanD numbers less than $x$ grows like ${2 \over 3}x$ as $x$ gets large, while the number of decimal SanD primes grows like ${3 \over 4}x/\log^2{x}$. In Section~\ref{sec4} we consider SanD primes with an arbitrary base $b$. The number of such primes less than $x$ is also expected to grow as $c_b x/\log^2{x}$, and we calculate the constant $c_b$. We show that $c_b=0$ when $b$ is odd. In Section~\ref{sec5} we give numerical results, notably the number of SanD primes less than $3 \cdot 10^{12}$, and show that the numerical data gives results consistent with the probabilistic arguments of the earlier section. Section~\ref{sec6} treats the case of binary SanD primes, which are also enumerated up to $3 \cdot 10^{12}$, and analysed. The next section gives an heuristic calculation of the number of SanD numbers less than $x$ by approximating the sum-of-digits function $s_{10}(p q)$ by an appropriately chosen Gaussian random variable. This gives rise to results in qualitative, though not quantitative agreement with the numerical data. We then compare this behaviour to that of the SanD primes.
\section{Possible values of $\Delta$ for base-10 SanD numbers and SanD primes}
\label{sec2}
\subsection{SanD numbers}\label{sn}
{\lemma For base-10 SanD numbers, $\Delta\equiv 5$ {\rm (mod 9)} or
$\Delta\equiv 0$ {\rm (mod 9)}.}
{\proof Any natural number $n$ can be written, in decimal form, as $$n=\sum_k \alpha_k \cdot 10^k.$$
Its digital sum, $s_{10}(n)=\sum_k \alpha_k$. Since $\alpha_k \cdot 10^k \equiv \alpha_k$ (mod 9), working (mod 9) it follows that every number is congruent to the sum of its digits. }
For SanD numbers we require that $s_{10}(n(n+\Delta))=\Delta$. So $n(n+\Delta)-\Delta\equiv 0$ (mod 9) or $(n-1)(n+\Delta+1)\equiv 8$ (mod 9). This excludes the values $n+\Delta \equiv 2,\,5,\,8$ (mod 9). This leaves the values $n+\Delta \equiv 0,\,3\,,6$ (mod 9) and $n+\Delta\equiv 1\,,4\,,7$ (mod 9). In the first case we have $\Delta\equiv 0$ (mod 9) and in the second case $\Delta\equiv 5$ (mod 9). Thus possible values of $\Delta$ are $9k$ and $5+9k$ for $k=1,2,3,4,\ldots$.
{\corollary The condition $\Delta \equiv 0$ {\rm (mod 9)} implies that the base-10 SanD numbers $(n,n+\Delta) \equiv (0,0)$ {\rm (mod 3)}.}
{\proof We have $n(n+\Delta)=n^2+\Delta n$. If $\Delta \equiv 0$ (mod 9), then $\Delta \equiv 0$ (mod 3) and so $n^2 \equiv 0$ (mod 3), hence $n \equiv 0$ (mod 3).}
{\corollary The condition $\Delta \equiv 5$ {\rm (mod 9)} implies that the base-10 SanD numbers $(n,n+\Delta) \equiv (2,1)$ {\rm (mod 3)}.}
{\proof We have $n(n+\Delta) \equiv 5$ (mod 9),
so $n^2+5n \equiv 5$ (mod 9), which has solution $n \equiv 2$ (mod 3). Hence $n+\Delta \equiv 1$ (mod 3).}
\subsection{SanD primes} \label{sp}
{\lemma For base-10 SanD primes, $\Delta\equiv 5$ {\rm (mod 9)}. If $\Delta$ is odd, the only prime-pair is $(2,7)$. If $\Delta$ is even, then $\Delta=14+18k$ with $k=0,1,2,3,4,\ldots$.}
{\proof For SanD primes we require that $s_{10}(p(p+\Delta))=\Delta$. So $p(p+\Delta)-\Delta\equiv 0$ (mod 9) or $(p-1)(p+\Delta+1)\equiv 8$ (mod 9). This excludes the values $p+\Delta \equiv 2,\,5,\,8$ (mod 9), and since $p+\Delta$ is prime, the values $p+\Delta \equiv 3,\,6\,,9$ (mod 9) are also excluded. This leaves $p+\Delta\equiv 1\,,4\,,7$ (mod 9) giving $p \equiv 5\,,8\,,2$ respectively. In each case we have $\Delta\equiv 5$ (mod 9). If $\Delta$ is odd, the only solution is $p=2,\,p+\Delta=7$ as for other primes $p$, $p+\Delta$ is even. If $\Delta$ is even the only solutions are $\Delta=14+18k$ with $k=0,1,2,3,4,\ldots$.}
{\corollary The condition $\Delta \equiv 5$ {\rm (mod 9)} implies that the base-10 SanD prime pair $(p,p+\Delta) \equiv (2,1)$ {\rm (mod 3)}.}
{\proof For the prime pair $(2,7)$ the result is immediate by inspection. Otherwise the proof is identical to that of the preceding corollary.}
\section{ The conjectured asymptotic behaviour of base-10 SanD numbers and SanD primes}\label{snos}
\label{sec3}
In this section we give heuristic arguments, but not proofs, that
the number of SanD numbers less than $x$ grows like $\frac{2}{3}x$
as $x$ gets large, while the corresponding result for SanD primes is
${3 \over 4} x\log^2{x}$.
The absence of proofs is hardly surprising since even
without the extra conditions that define SanD primes, no results for
prime pairs $(p, q)$ with fixed gap $\Delta=q-p$ have been proved,
despite the remarkable recent developments described in the papers of
Zhang \cite{Z14} and Maynard \cite{M19}.
\subsection{SanD numbers} \label{sandnos}
Base-10 SanD {\em numbers\/} less than $x$ are defined as the set of ordered pairs $(a,b)$ such that $1 \le a < b \le x$ and $b-a=s_{10}(a b)$.
There are $x(x-1)/2 \sim x^2/2$ choices for the pair $(a,b)$ such that $1 \le a < b \le x$.
The digital sum constraint implies that $s_{10}(a b)\equiv 5$ (mod 9) or $0$ (mod 9).
We conjecture that this constraint reduces the quadratic growth of number pairs to linear growth. To see this, first note that $b-a=s_{10}(a^2)$ has exactly one solution for each $a$, namely $b=s_{10}(a^2)+a$.
So asymptotically there are precisely $x$ such numbers $\le x$. However it is not true that $b-a=s_{10}(ab)$ has a solution $b$ for every $a$, and it is also possible (though it occurs infrequently) that for some values of $a$ there is more than one solution $b$. Accordingly, we write $c_1 x$ for the number of SanD numbers less than or equal to $ x$ solving $b-a=s_{10}(a b)$.
A totally different, but more complicated argument is the following: in 1968 K\'atai and Mogyor\'odi \cite{KM68} proved the asymptotic normality of the sum-of-digits function with mean $M={9 \over 2}\log_{10}{x}$ (this was known since 1940; see \cite{B40}), and variance $V= {{33} \over 4} \log_{10}(x)$. Then $s_{10}(a b) = b-a$ holds with a probability that is, for each potential pair $(a,b)$ given by the Gaussian
\begin{equation}\label{eqnP}
P(a,b)=\frac{1}{\sqrt{2\pi V}}\exp \left ( \frac{-(b-a-M)^2}{2V} \right ).
\end{equation}
Since both $M$ and $V$ are very small compared to $x$, all pairs $(a,b)$ ocurring with appreciable probability have $a$ and $b$ close to the square-root of $x$. Thus $a b \sim c x$ for some constant $c$.
First note that there is only one value of $b$ satisfying $b-a=s_{10}(a^2)$, notably $b=s_{10}(a^2)+a$. Then we argue that there is probabilistically only one value of $b$ satisfying $b-a=s_{10}(a b)$.
From corollaries 2 and 3, SanD numbers must satisfy $$(a,\,b)\equiv (0,0) \,\,({\rm mod}\,\,3)\,\,\,{\rm or}\,\,(2,1)\,\,({\rm mod}\,\,3).$$
If $a \equiv (0) ({\rm mod}\,\,3)$, for which the probability is $1/3$, then there is, as we have just argued, one value of $b$ satisfying the SanD condition. So the number of SanD numbers satisfying $(a,\,b)\equiv (0,0) \,\,({\rm mod}\,\,3)$ (and $a < b 0$. Then
$$S(S + 14) = 51 + 2.10^{r+1} + 2.10^{s+1} + 10^{2r}+10^{2s} + 2.10^{r+s}.$$
The digital sum $(5+1+2+2+1+1+2)$ is 14 for every such product, so the number of prime-pairs is, probabilistically speaking, infinite.
\end{proof}
Similarly, for $\Delta=32$, for the same number $S$ we have
$s_{10}(S(S+32)) =32$. For $\Delta=50$, the appropriate choice is $S= 7 + 3\cdot 10^r + 10^s$, with $r,\,s > 0$. Then $s_{10}(S(S+50)) =50$.
Similar such numbers $S$ can be found for other values of $\Delta$, showing that for every valid $\Delta$ there is an infinite number of SanD numbers, and so, probabilistically speaking, an infinite number of SanD primes.
Referring again to Table~\ref{tab1}, Richard Brent (private communication) pointed out (i) that the diagonal above which the entries are zero can be immediately predicted from the fact that $s_{10}(n) < 9d$ for $n < 10^d$, (ii) that the maximal entry in each row occurs approximately halfway to the boundary, and (iii) that the above probabilistic argument can be extended to conjecture the growth of $N_\Delta(x)$, the number of SanD primes $x$ with $x < X$ and difference $\Delta$. In particular, that $N_{14}(X)\gg \log\log{X}$.
\begin{sidewaystable}[htp!]
\vspace{0.1cm}
\centering
\tabcolsep=0.06cm
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
$x$&$\Delta=14$&32&50&68&86&104&122&140&158&176&194\\
\hline
$10^2$&7&0&0&0&0&0&0&0&0&0&0\\
$3 \cdot 10^2$&9&4&0&0&0&0&0&0&0&0&0\\
$10^3$&11&10&0&0&0&0&0&0&0&0&0\\
$3 \cdot 10^3$&14&29&1&0&0&0&0&0&0&0&0\\
$10^4$&15&69&21&0&0&0&0&0&0&0&0\\
$3 \cdot 10^4$&16&136&109&2&0&0&0&0&0&0&0\\
$10^5$&16&218&464&14&0&0&0&0&0&0&0\\
$3 \cdot 10^5$&18&329&1310&134&0&0&0&0&0&0&0\\
$10^6$&18&451&3579&954&8&0&0&0&0&0&0\\
$3 \cdot 10^6$&19&582&7740&4099&98&0&0&0&0&0&0\\
$10^7$&19&722&15662&16417&1170&2&0&0&0&0&0\\
$3 \cdot 10^7$&19&826&27871&48714&7831&82&0&0&0&0&0\\
$ 10^8$&19&944&47206&139196&48831&1985&6&0&0&0&0\\
$3 \cdot 10^8$&19&1014&72994&315414&200810&16247&126&0&0&0&0\\
$10^9$&19&1094&106919&696450&813091&135580&3213&0&0&0&0\\
$3 \cdot 10^9$&19&1134&147652&1347257&2508310&699799&31654&88&0&0&0\\
$10^{10}$&19&1178&195617&2499225&7575349&3686127&329134&3302&0&0&0\\
$3 \cdot 10^{10}$&19&1201&247383&4213080&18918254&13982418&1995357&43223&158&0&0\\
$10^{11}$&19&1222&303418&6850021&46040607&53629221&12799997&651464&965&0&0\\
$3 \cdot 10^{11}$&19&1240&359059&10361558&97588868&163082279&56956080&5104309&18913&8&0\\
$10^{12}$&19&1247&414440&15154071&201275729&497036770&264337125&44101608&425673&911&0\\
$3 \cdot 10^{12}$&19&1262&466029&20993451&373934734&1273600647&938235422&243895420&4365872&21996&3\\
\hline
\end{tabular}
\label{tab1}
\caption{SanD primes data. The contribution from $\Delta=5$ adds 1 to each row and is not shown here. }
\end{sidewaystable}
Assuming that the number of SanD primes less than $x$ grows like $ c_2 x/\log^2{x}$ as argued above, we have estimated the value of the constant $c_2$ in three different ways. Firstly, as the number of primes less than $x$, denoted as usual by $\pi(x)$, grows like $x/\log{x}$, it follows that $xT(x)/\pi(x)^2$ should converge to $c_2$.
This estimator is given in the third column of Table~\ref{tab2}. Another estimator is $T(x)\log^2{x}/x$, while if the asymptotics are similar to that of twin primes, $T(x)/\Li_2(x)$ would converge more rapidly. Recall that asymptotically $$\Li_2(x) = \frac{x}{\log^2{x}}\left (1+\frac{2}{\log{x}} + \frac{6}{\log^3{x}} + O\left ( \frac{1}{\log^4{x}} \right ) \right ),$$ while \cite{dlVP99}
$$ \frac{\pi^2(x)}{x}=\frac{x}{\log^2{x}}\left (1+\frac{2}{\log{x}} + \frac{5}{\log^3{x}} + O\left ( \frac{1}{\log^4{x}} \right ) \right ),$$ so these differ only in the last quoted coefficient, and even then by only 20\%.
These last two estimators are given in columns four and five of Table~\ref{tab2}. Both seem to fit the SanD distribution somewhat better than the leading term, $x/\log^2{x}$, and the same is true for binary SanD primes, discussed below. This may not persist for larger values of $x$ than we are able to compute.
In no case is convergence regular, unlike the corresponding situation for primes or twin primes. This is not surprising as the SanD primes are likely to have jagged irregularities in their distribution because the digit-sum function has jagged irregularities whenever the first or second digit changes from nine to zero.
The data in Table~\ref{tab2} is totally consistent with a value of $c_2 \approx 0.75$. Taking data for $x \ge 10^6$, the third column entries average around $c_2=0.725$, the fourth column average is $c_2=0.811$, and the fifth column gives $c_2=0.721$. This variation is indicative of the jagged convergence, and an estimate of $c_2 \approx 0.75$ seems appropriate, in agreement with our calculation above.
\begin{table}[htp]
\vspace{1mm}
\centering
\tabcolsep=0.11cm
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
$x$&Total=$T(x)$&$xT(x)/\pi(x)^2$&$T(x)\log^2(x)/x$&$T(x)/\Li_2(x)$\\
\hline
$10^2$&8&1.2800&1.697&0.7804\\
$3 \cdot 10^2$&14&1.0926&1.518&0.7965\\
$10^3$&22&0.7795&1.050&0.6343\\
$3 \cdot 10^3$&45&0.7301&0.9615&0.6438\\
$10^4$&106&0.7018&0.8992&0.6533\\
$3 \cdot 10^4$&264&0.7521&0.9352&0.7161\\
$10^5$&713&0.7749&0.9450&0.7539\\
$3 \cdot 10^5$&1792&0.7954&0.9501&0.7789\\
$10^6$&5011&0.8132&0.9564&0.8021\\
$3 \cdot 10^6$&12539&0.8002&0.9297&0.7926\\
$10^7$&33993&0.7697&0.8831&0.7639\\
$3 \cdot 10^7$&85344&0.7418&0.8432&0.7375\\
$ 10^8$&238188&0.7085&0.8082&0.7141\\
$3 \cdot 10^8$&606625&0.6890&0.7704&0.6862\\
$10^9$&1756367&0.6793&0.7543&0.6770\\
$3 \cdot 10^9$&4735914&0.6809&0.7517&0.6789\\
$10^{10}$&14289952&0.6901&0.7576&0.6883\\
$3 \cdot 10^{10}$&39400953&0.6994&0.7643&0.6978\\
$10^{11}$&120276935&0.7092&0.7716&0.7078\\
$3 \cdot 10^{11}$&333472334&0.7162&0.7763&0.7149\\
$10^{12}$&1022747594&0.7231&0.7808&0.7219\\
$3 \cdot 10^{12}$&2855514856&0.7298&0.7856&0.7287\\
\hline
\end{tabular}
\label{tab2}
\caption{Decimal SanD prime analysis. $\pi(x)$ is the number of primes $< x$. The totals include the contribution of 1 from $\Delta=5$.}
\end{table}
\section{Binary SanD primes}
\label{sec6}
We have also investigated the properties of SanD primes in base 2. The number of such SanD primes $B(x)$ less than $x$ for $x=10^n, \,\,n=2,3,4,\ldots,12$ and $x=3\cdot 10^{n}$ for $n=9, \ldots, 12$, is given in the second column of Table~\ref{b2const}. Note that $B(10)=0$.
As with base-10 SanD primes, we write $B(x) \sim b_2x/\log^2{x}$, and estimate the constant $b_2$ three different ways. The results are shown in Table~\ref{b2const}.
We see that convergence is significantly smoother than in the base-10 case, but still not monotonic, due to the jagged irregularities in the digit-sum function.
Nevertheless, a glance at the table entries would suggest a limit of 1 and this is as calculated in Section \ref{arb}.
These numbers show
clearly the difference between decimal and binary digit-sums. The
decimal sum of $x$ differs from $x$ by a multiple of 9, and this causes
the bunching of SanD primes into the groups $\Delta= 14,\, 32,\, 50$, etc. In
the binary case the 9 is replaced by 1, and the divisibility by 1
does not cause any bunching. There is only the divisibility by 2
imposed by the fact that all primes after 2 are odd. So we see
that the binary coefficients converge to the value 1 rather than
3/4. For the binary case, there is no special prime that plays the
role of 3 in the decimal case, and every SanD
integer pair of size $x$ has an equal chance $1/\log^2{ x}$ of being a
prime-pair.
\begin{table}[htp]
\centering
\tabcolsep=0.11cm
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
$x$&Total=$B(x)$&$xB(x)/\pi(x)^2$&$B(x)\log^2(x)/x$&$B(x)/\Li_2(x)$\\
\hline
$10^2$&6&0.9600&1.2724& 0.5853\\
$10^3$&32&1.1338&1.5269& 0.9226\\
$10^4$&172&1.1387&1.4591& 1.0601\\
$10^5$&922&1.0021& 1.2221& 0.9749\\
$10^6$&5632&0.9140& 1.0750& 0.9016\\
$10^7$&41421&0.9378& 1.0761& 0.9308\\
$ 10^8$&335551&1.0109& 1.1386& 1.0061\\
$10^9$&2637661&1.0202& 1.1328& 1.0167\\
$3 \cdot10^{9}$&7017793&1.0090&1.1139& 1.0060\\
$10^{10}$&20619112&0.9957& 1.0932& 0.9932\\
$3 \cdot 10^{10}$&55563472&0.9863& 1.0779& 0.9840\\
$10^{11}$&167019412&0.9849& 1.0715& 0.9828\\
$3 \cdot 10^{11}$&460924135&0.9900&1.0730&0.9881\\
$10^{12}$&1410277428&0.9970& 1.0767& 0.9954\\
$3 \cdot 10^{12}$&3905976118&0.9983& 1.0747& 0.9968\\
\hline
\end{tabular}
\label{b2const}
\caption{Binary SanD prime analysis. $\pi(x)$ is the number of primes $< x$.}
\end{table}
\section{Irregular convergence}
\label{sec7}
\subsection{SanD numbers}
In this section we give an heuristic calculation for the irregular behaviour of decimal SanD numbers, based on the approximation that each sum-of-digits function $s_{10}(a b)$ can be replaced by
a Gaussian random variable, with mean value
$M={9 \over 2} \log_{10}(u)$ and variance $V={{33} \over 4} \log_{10}(u)$, where $u=a b$. Here
${9 \over 2}$ is the mean
value of a decimal digit, and ${{33} \over 4}$ is the mean-square-deviation from the
mean, as discussed above in Eqn.~(\ref{eqnP}).
This approximation is good when $u$ is large and
the $\log_{10}(u)$ digits are statistically independent variables. Then the
equation $s_{10}(a b) = b-a$ holds with a probability that is for each potential
pair $(a,b)$ equal to the Gaussian Eqn.~(\ref{eqnP}).
Since $M$ and $V$ are very small
compared with $u$, all pairs that occur with appreciable probability have $a$ and $b$ both
close to the square root of $u$. The potential SanD numbers $(a,b)$ lie in a narrow strip around the line
$a=b$. To accord with the SanD prime calculation, we restrict the allowed values of $b-a$ to be integers of the form $18j-4$ with $ j=1,2,3,\ldots $.
Therefore the population density of SanD numbers
is given by the sum
$$W(u) = \frac{1}{\sqrt{2\pi V}}†\sum_{j \ge 0} \exp\left (-162\frac{\left (j-\frac{4+M}{18}\right )^2}{V}\right ),$$
summed over integer $ j$. The sum is strictly over positive $ j$, but we can
extend it to all positive and negative $j$ without significant error, since
the terms with negative $j $ are much smaller than unity.
The sum $W(u)$ can be transformed to a rapidly converging sum by using
the Poisson
Summation formula, giving
$$W(u) = \sum_{j=-\infty}^{j=\infty} \exp\left (-\frac{V\pi^2 j^2}{162} +\pi.ij\frac{4+M}{9}\right ).$$
We keep only the three terms of the transformed sum with $ j = 0, 1$ and
$-1$. These give
$$W(u) = 1 +2 u^{-a}\cos\left (\frac{\pi}{2}\left (\log_{10}(u)+\frac{8}{9}\right )\right ),$$
with exponent
$$a = \frac{11\pi^2}{216\log(10)} \approx 0.218.$$
The omitted terms with $|j|>1$ are of order $u^{-4a}$ or smaller and are
certainly negligible.
The equation for $W(u)$ shows that the SanD numbers occur with
approximately
constant population density 1 as a function of the square-root of $u$, with
a deviation which is a low power of $u$ multiplied by a cosine periodic in
$\log_{10}(x)$ with period 4.
Since the digit-sums are not in fact independent random variables,
this calculation
using Gaussian probabilities is not rigorous.
In our previous calculations, we have been counting SanD numbers and primes $(a,b)$ such that $a** 0$. We considered in detail both the decimal ($b=10$) and the binary ($b=2$) case. If both $m$ and $n$ are prime numbers, we refer to SanD {\em primes}. Subject to the unproven assumption that primes behave as pseudorandom numbers, in a manner described above, we show that the number of (base-10) SanD numbers less than $x$ grows like $c_1 x$, where $c_1 = 2/3$, while the number of SanD primes less than $x$ grows like $c_2 x/\log^2{x}$, where $c_2 = 3/4$. The value of the corresponding constants for arbitrary base-$b$ were also calculated. For binary SanD primes we show similarly that the number of such primes $B(x) < x$ behaves like $B(x) \sim b_2 x/\log^2{x}$ with $b_2=1$.
We calculated the number of SanD numbers and primes $< 3 \cdot 10^{12}$ in order to test the above calculations. The numerical data was consistent with the conjectured results. However due to the sawtooth nature of the digital sum function, convergence of the estimators of the constants $c_1$ and $c_2$ with increasing $x$ was found to be more erratic than the corresponding situation with twin primes, which, apart from the constant, have the same leading asymptotics.
The twin prime distribution fits well the SanD prime pair numbers in
both the decimal and binary cases (at least for primes less than $3 \cdot
10^{12}$), i.e., $c \Li_2(x)$ where $c = 3/4$ and 1 respectively,
in contrast with the twin prime conjecture \cite{HL23} with $c =2C_2 =
1.32\cdots$, where $C_2$ is the twin prime constant.
\section{Acknowledgments}
\label{sec9}
AJG would like to thank Andrew Conway for writing a C program to count SanD primes, Andrew Elvey Price for helpful discussions, Richard Brent for a thorough reading of an earlier version of this paper and many suggested improvements, and Jeffrey Shallit for useful suggestions. He also gratefully acknowledges support from ACEMS the ARC Centre of Excellence for Mathematical and Statistical Frontiers. We wish to acknowledge the valuable input of the the unknown referee whose comments improved the paper.
\section{Appendix}
In the table below we show some SanD prime enumerations, giving the first 19 SanD primes for the first few values of $\Delta$. For each entry $p$ it follows that $s_{10}(p(p+\Delta))=\Delta$. There is one further entry, not shown, corresponding to the sole SanD prime when $\Delta=5$, which is $p=2$.
\begin{table}[htp]
\centering
\tabcolsep=0.11cm
\begin{tabular}{|c|c|c|c|c|}
\hline
$\Delta=14$&$\Delta=32$&$\Delta=50$&$\Delta=68$&$\Delta=86$\\ \hline
5 &149 & 2543 & 19961 & 412253 \\
17 &179 & 3137 & 28211 & 547661 \\
23& 239 & 3407 & 43541 & 871163 \\
29& 281 & 4973 & 44111 & 937661 \\
53& 389 & 5147 & 62861 & 982703 \\
59& 431 & 5693 & 66821 & 989381 \\
83& 491 & 7193 & 69941 & 992363 \\
113&509 & 7523 & 83621 & 996551 \\
167&569 & 7649 & 86561 & 999917 \\
383&659 & 7673 & 88721 & 999953 \\
443&1019 & 8243 & 89261 & 1296101 \\
1103&1031 & 8513 & 92111 & 1297601 \\
1409&1061 & 8573 & 94781 & 1329863 \\
2003&1259 & 8627 & 99191 & 1336253 \\
3203&1289 & 9293 & 120671& 1337813 \\
11483&1427 & 9461 & 125261& 1378253 \\
100043&1439 & 9497 & 129461& 1410203 \\
200003 &1901 & 9767 & 129959& 1608611 \\
1001003 & 2081 &9833& 130211& 1642211 \\
\hline
\end{tabular}
\label{tabnew}
\caption{Low-order SanD primes.}
\end{table}
\begin{thebibliography}{99}
\bibitem{FAR09} F. T. Adams-Watters and F. Ruskey, Generating functions for the digital sum and other digit counting sequences, {\em J. Integer Sequences} {\bf 9} (2009), 1--8.
\bibitem{B40} L. E. Bush, An asymptotic formula for the average sum of the digits of integers, {\em Amer. Math. Monthly} {\bf 47} (1940), 154--156.
\bibitem{C00} C. H. Caldwell, An amazing prime heuristic, 2000. Available at
\url{https://www.utm.edu/staff/caldwell/preprints/Heuristics.pdf}.
\bibitem{CH14} L. H. Y. Chen and H.-K. Hwang,
Distribution of the sum-of-digits function of random integers: a survey, {\em Probab. Surv.} {\bf 11} (2014), 177--236.
\bibitem{C36} H. Cram\'er, On the order of magnitude of the difference between consecutive prime numbers, {\em Acta Arith.} {\bf 2} (1936), 23--46.
\bibitem{D75} H. Delange, Sur la fonction sommatoire de la fonction ``somme des chiffres'', {\em Enseignement Math.} {\bf 21} (1975), 31--47.
\bibitem{dlVP99} C. J. de la Valle\'e Poussin, Recherches analytiques sur la th\'eorie des nombres premiers, {\em Ann. Soc. Sci. Bruxelles} {\bf 20} (1896), 183--256.
\bibitem{FGKBT} P. Flajolet, P. Grabner, P. Kirschenhofer, H. Prodinger,
and R. F. Tichy, Mellin transforms and asymptotics: digital sums,
{\em Theor. Comp. Sci.} {\bf 123} (1994) 291--314.
\bibitem{HL23} G. H. Hardy and J. E. Littlewood, Some problems of `partitio numerorum' III: on the expression of a number as a sum of primes, {\em Acta Math.} {\bf 44} (1923), 1--70.
\bibitem{KM68} I. K\'atai and J. Magyor\'odi, On the distribution of digits, {\em Publ. Math. Debrecen} {\bf 15} (1968) 57--68.
\bibitem{L98} A. Legendre, {\em Th\'eorie des Nombres}. 4th edition,
Firmin Didot Fr\`eres, 1900.
\bibitem{M85} H. Maier, Primes in short intervals, {\em Michigan Math. J.} {\bf32} (1985), 221--225.
\bibitem{M19}J. Maynard, Small gaps between primes, {\em Ann. Math.}
{\bf 181} (2015), 1--31.
\bibitem{M49} L. Mirsky, A theorem on representations of integers in the scale of $r$, {\em Scripta Math.} {\bf 15} (1949) 11--12.
\bibitem{P07} J. Pintz, Cram\'er vs. Cram\'er. On Cram\'er's probabilistic model for primes, {\em Functiones et Approx.} {\bf 37} (2007), 361--376.
\bibitem{T09} T. Tao, Structure and randomness in the prime numbers,
in Dierk Schleicher and Malte Lackmann, eds., {\it An Invitation to
Mathematics: From Competitions to Research}, Springer-Verlag,
2011, pp.~1--7.
\bibitem{T15} T. Tao, Probabilistic models and heuristics for the primes,
2015. Available at \url{https://tinyurl.com/vkncupy}.
\bibitem{Z14} Y. Zhang, Bounded gaps between primes, {\em Ann. Math.} {\bf 179} (2014) 1121--1174.
\end{thebibliography}
\bigskip
\hrule
\bigskip
\noindent 2010 {\it Mathematics Subject Classification}:
Primary 11A41; Secondary 11A63, 11Y55, 11Y60.
\noindent \emph{Keywords: }
SanD number, constrained prime pair, digital sum, asymptotics of primes.
\bigskip
\hrule
\bigskip
\vspace*{+.1in}
\noindent
Received April 17 2019;
revised version received July 22 2019; January 7 2020.
Published in {\it Journal of Integer Sequences}, February 24 2020.
\bigskip
\hrule
\bigskip
\noindent
Return to
\htmladdnormallink{Journal of Integer Sequences home page}{https://cs.uwaterloo.ca/journals/JIS/}.
\vskip .1in
\end{document}
**