\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}}}

\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}

\newcommand{\Q}{\mathbb Q}
\newcommand{\Z}{\mathbb Z}

\begin{center}
\vskip 1cm{\LARGE\bf Euler's Divergent Series in \\
\vskip .1in 
Arithmetic Progressions}
\vskip 1cm
\large
Anne-Maria Ernvall-Hyt\"onen\footnote{Supported by the Finnish Cultural Foundation.}\\
Matematik och Statistik\\
{\AA}bo Akademi University\\
Domkyrkotorget 1\\
20500 {\AA}bo\\
Finland\\
\href{mailto:anne-maria.ernvall-hytonen@abo.fi}{\tt anne-maria.ernvall-hytonen@abo.fi} \\
\ \\
Tapani Matala-aho and
Louna Sepp\"al\"a\footnote{Supported by the University of Oulu Scholarship Foundation and the Vilho, Yrj\"o and Kalle V\"ais\"al\"a Foundation.}\\
Matematiikka\\
PL 8000\\
90014 Oulun yliopisto\\
Finland\\
\href{mailto:tapani.matala-aho@oulu.fi}{\tt tapani.matala-aho@oulu.fi}\\
\href{mailto:louna.seppala@oulu.fi}{\tt louna.seppala@oulu.fi}
\end{center}

\vskip .2 in

\begin{abstract}
Let $\xi$ and $m$ be integers satisfying $\xi\ne 0$ and $m\ge 3$. 
We show that for any given integers $a$ and $b$, $b \neq 0$, there are $\frac{\varphi(m)}{2}$ reduced residue classes modulo $m$ each containing 
infinitely many primes $p$ such that $a-bF_p(\xi) \ne 0$, where $F_p(\xi)=\sum_{n=0}^\infty n!\xi^n$ is the $p$-adic evaluation of Euler's factorial series at the point $\xi$.
 \end{abstract}


\section{Introduction and results}


Euler's factorial series is defined as the sum
\begin{equation}\label{hyperseries}
F(z):={}_2F_0(1,1\mid z)=\sum_{n=0}^\infty n!z^n.
\end{equation}
It is clear that in the standard Archimedean metric, it only converges when $z=0$. 
In the case of the $p$-adic metric, however, the situation changes drastically.
For a prime $p$ the normalization $|p|_p=p^{-1}$ gives the usual $p$-adic absolute value.
The $p$-adic completion of the rationals $\mathbb{Q}$ with respect to the metric $|\cdot|_p$ is denoted by $\mathbb{Q}_p$.
Now the series \eqref{hyperseries} converges in the disc $\left\{z\in\mathbb{Q}_p \; \left| \; |z|_p < p^{\frac{1}{p-1}} \right. \right\}$ and consequently defines a function $F_p$
in that disc by the values $F_p(z):=\sum_{n=0}^\infty n!z^n$.

We are interested in arithmetical properties of the values $F_p(\xi)$ of Euler's factorial series at non-zero integer points
$\xi \in \Z \setminus \{0\}$. It is an open question whether, e.g., the values $F_p(\pm 1)$ are irrational or even non-zero, 
which is why it has become customary to study global relations. Let $P(x)\in \mathbb{Z}[x]$, $d := \deg P(x)\ge 1$.
For a given $\xi$, a \emph{global relation of degree $d$} is any polynomial identity $P(F_p(\xi))=0$ which is satisfied for all the primes $p$ such that 
$F_p(\xi)$ is defined.
There are several papers considering global relations of the series \eqref{hyperseries} and its generalizations,
including generalized hypergeometric series; see, e.g., \cite{BCY04, Chirskii1992, Chirskii2014}.

Chirski\u \i \ \cite{Chirskii2015} and  Matala-aho and Zudilin \cite{TapaniWadim} have recently investigated first degree global relations of Euler's factorial series. Chirski\u \i \ proved (with our notation)

\begin{proposition}\label{Chirskiiglobal}\cite{Chirskii2015}
There exist infinitely many primes $p$ such that $F_p(1) \ne 0$.
\end{proposition}

Matala-aho and Zudilin \cite{TapaniWadim} proved

\begin{proposition}\label{TAWA}\cite{TapaniWadim}
Given $\xi\in\mathbb{Z}\setminus\{0\}$, let $R\subseteq \mathbb{P}$ be  such that
\begin{equation}\label{riistajaehto}
\limsup_{n\to\infty} c^nn!\prod_{p\in R}|n!|_p^2=0,
\quad\text{where}\; c=c(\xi;R):=4|\xi|\prod_{p\in R}|\xi|_p^2.
\end{equation}
Then either there exists a prime $p\in R$ for which $F_p(\xi)$ is irrational, or there are two distinct primes $p,q\in R$
such that $F_p(\xi)\ne F_q(\xi)$ \textup(while $F_p(\xi), F_q(\xi)\in \mathbb{Q}$\textup).
\end{proposition}

From now on, let $\Lambda(x)=a-bx\in\mathbb{Z}[x]$, $b\ne 0$. Note that Proposition \ref{Chirskiiglobal}
corresponds to the case $\Lambda(x)=x$ and Proposition \ref{TAWA} to the case $\Lambda(x)=a-bx$.
Based on Proposition \ref{TAWA}, we are able to prove a more extensive result, Theorem \ref{AB}, which we shall formulate by using the polynomial $\Lambda(x)=a-bx$.

For the rest of the work we assume $\xi\in\mathbb{Z}\setminus\{0\}$.

\begin{theorem}\label{AB}
Let $T\subseteq\mathbb{P}$ be a subset of primes such that the set $T\setminus S$ satisfies condition \eqref{riistajaehto} for any
finite subset $S$ of $T$.
Then there exist infinitely many primes $p\in T$ such that $\Lambda(F_p(\xi))\ne 0$.
\end{theorem}


\begin{proof}
Define
\begin{equation*}
\mathcal{R}:=\left\{R\subseteq \mathbb{P} \; | \; R\ \text{satisfies condition}\ \eqref{riistajaehto} \right\}.
\end{equation*}
If $R\in \mathcal{R}$, the proof of Proposition \ref{TAWA} in \cite{TapaniWadim}
shows that there exists at least one prime $p\in R$ such that $\Lambda(F_p(\xi)) \ne 0$.

Take now a subset $T$ of primes such that $T\setminus S \in \mathcal{R}$ for any finite subset $S$ of $T$. 
Define a new set 
\begin{equation*}
A:= \left\{p\in T\; |\; \Lambda(F_p(\xi)) \ne 0 \right\}.
\end{equation*}
If the set $A$ is finite, then $T\setminus A\in \mathcal{R}$ by assumption.
But
\begin{equation*}
T\setminus A=\{p\in T\; |\; \Lambda(F_p(\xi))= 0 \}.
\end{equation*}
This is a contradiction, and thus $\# A=\infty$.
\end{proof}

From Theorem \ref{AB} it follows that for any set $R\in \mathcal{R}$ satisfying the assumptions of Theorem \ref{AB}, 
there exist infinitely many primes $p\in R$ such that $F_p(\xi) \ne \frac{a}{b}$.
In particular, if we take $T=\mathbb{P}$, then we see immediately that any 
$\mathbb{P}\setminus S \in \mathcal{R}$, if $S$ is a finite set of primes.
Thus, Theorem \ref{AB} implies the following corollary.

\begin{corollary}\label{Corkaikkip}
Let $\frac{a}{b} \in \mathbb{Q}$ be given. 
Then there exist infinitely many primes $p\in \mathbb{P}$ such that $F_p(\xi) \ne \frac{a}{b}$. 
\end{corollary}

This still seems to be far from implying irrationality, for the prime $p=p_{\Lambda}\in R$ for which $F_p(\xi) \ne \frac{a}{b}$, 
may depend on the polynomial $\Lambda(x)=a-bx$. We note that there are results (see, e.g., \cite{BCY04, Chirskii1992}) from which Corollary \ref{Corkaikkip} follows, but the proof presented here is different from these earlier articles. 
As will be seen shortly, we may also considerably diminish the prime number set where Corollary \ref{Corkaikkip} is still valid.

The question rises whether, for example, the reduced residue system modulo $m$, $m\in\mathbb{Z}_{\ge 3}$, 
could produce examples of prime subsets satisfying condition \eqref{riistajaehto}.
Indeed, that is the case, as will be demonstrated in the following theorem, the main result of this paper.

Let $m \in \Z_{\ge 3}$ and denote $\overline{h} := \{ h+km \; | \; k \in \Z \}$. We write $\overline{h}_1, \ldots, \overline{h}_{\varphi (m)}$ 
for the $\varphi (m)$ residue classes in the reduced residue system modulo $m$. Dirichlet's theorem about primes in arithmetic progressions says that each of these classes contains infinitely many prime numbers.


\begin{theorem}\label{epatasa}
Let $m\in\mathbb{Z}_{\ge 3}$ be a given integer. Assume that $R=\bigcup_{j=1}^r \left( \overline{h}_{i_j} \cap \mathbb{P} \right)$ 
is any union of the primes in $r$ residue classes in the reduced residue system modulo $m$, where $r > \frac{\varphi(m)}{2}$. 
Then there are infinitely many primes $p \in R$ such that $\Lambda(F_p(\xi))\ne 0$.
\end{theorem}

Observe that the `relation set' $G_{\Lambda}:=\{p\in\mathbb{P}\;|\; \Lambda(F_p(\xi))=0\}$ cannot be too big:
By Theorem \ref{AB}, the set $G_{\Lambda}$ obviously cannot satisfy condition \eqref{riistajaehto}.
Theorem \ref{epatasa} shows that the set $G_\Lambda$ cannot contain the primes of more than half of the reduced residue classes modulo $m$.
Therefore $F_p(\xi) \ne \frac{a}{b}$ holds---in the above sense---for at least `half' of all the primes $p\in\mathbb{P}$.

Theorem \ref{epatasa} implies that there is a residue class modulo $m$ containing infinitely many primes $p$ for which $\Lambda(F_p(\xi))\ne 0$.
Since the union $R$ may be chosen arbitrarily, we actually obtain: 

\begin{corollary}\label{corollary6}
Let $m\in\mathbb{Z}_{\ge 3}$ be a given integer. There are $\frac{\varphi(m)}{2}$ reduced residue classes modulo $m$ each containing infinitely many primes $p$ such that $F_p(\xi) \ne \frac{a}{b}$.
\end{corollary}

\begin{proof}
By Theorem \ref{epatasa}, the union $\bigcup_{i=1}^{\frac{\varphi(m)}{2}+1} \overline{h}_i$ contains infinitely many primes $p$ such that 
$\Lambda(F_p(\xi))\ne 0$. Thus one of the reduced residue classes $\overline{h}_1, \ldots, \overline{h}_{\frac{\varphi(m)}{2}+1}$ 
must contain infinitely many such primes---suppose it is $\overline{h}_1$. Now we may apply Theorem \ref{epatasa} again to the union 
$\bigcup_{i=2}^{\frac{\varphi(m)}{2}+2} \overline{h}_i$, and without loss of generality assume that this time the residue class containing 
infinitely many of those certain primes is $\overline{h}_2$. This procedure can be repeated $\frac{\varphi (m)}{2}$ times, 
from which the assertion follows.
\end{proof}

The number $\frac{\varphi(m)}{2}$ is always an integer because $\varphi(m)$ is even when $m\ge 3$. The case $m=2$ is of no interest 
because all the primes except the prime $2$ are in the same residue class.

Let $P(x) \in \Z[x]$ be a polynomial of degree $d$ and write it in the form
\begin{align*}
P(x) = \;&a_d (x+1)(x+2) \cdots (x+d) + a_{d-1} (x+1)(x+2) \cdots (x+d-1) \\
&+ \cdots + a_2 (x+1)(x+2) + a_1(x+1) + a_0,
\end{align*}
where $a_i \in \Z$, $i=0,1,\ldots,d$. Chirski\u\i \ \cite{Chirskii2017} has shown that in any $\Q_p$,
$$
\sum_{n=0}^\infty P(n) n! = A F_p(1) + B,
$$
where
$$
A:= \sum_{i=0}^d a_i \in \Z, \quad B:= - \left( a_d \sum_{n=0}^{d-1} n! + a_{d-1} \sum_{n=0}^{d-2} n! + \cdots + a_2 1! + a_1 \right) \in \Z.
$$
Thus we may state another corollary:

\begin{corollary}\label{corollary7}
Let $m\in\mathbb{Z}_{\ge 3}$ be a given integer and $P(x) \in \Z[x]$ a polynomial such that $A \neq 0$ in the above notation. Then, for any $s, t \in \Z$, $t \neq 0$, there are $\frac{\varphi(m)}{2}$ reduced residue classes modulo $m$ each containing infinitely many primes $p$ such that
$$
\sum_{n=0}^\infty P(n) n! \ne \frac{s}{t}.
$$
\end{corollary}

\begin{proof}
Choose $\xi=1$, $a= s-tB$, and $b=tA \neq 0$ in Corollary \ref{corollary6}. It follows that there are $\frac{\varphi(m)}{2}$ reduced residue classes modulo $m$ each containing infinitely many primes $p$ such that
$$
s-t\sum_{n=0}^\infty P(n) n! = s-tB - tAF_p(1) = a-bF_p(1) \neq 0.
$$
\end{proof}
 
Finally, assuming the generalized Riemann hypothesis (GRH), we can say something slightly different, namely that in any collection of $\frac{\varphi(m)}{2}$ residue classes in the reduced residue system modulo $m$, there is at least one prime satisfying the condition $\Lambda(F_p(\xi))\ne 0$ but now for a $\xi$ satisfying the condition of Theorem \ref{tasa}. The previous theorem gave us the existence of infinitely many such primes in some $\frac{\varphi(m)}{2}$ residue classes. Now we can prove that also in the complement of the previous $\frac{\varphi(m)}{2}$ residue classes, there must be at least one prime satisfying the condition.

\begin{theorem}\label{tasa}
Assume the GRH. Let $m\in\mathbb{Z}_{\ge 3}$ be a given integer. Assume that $R=\bigcup_{j=1}^{\varphi(m)/2} \left( \overline{h}_{i_j} \cap \mathbb{P} \right)$ 
is any union of the primes in $\frac{\varphi(m)}{2}$ residue classes in the reduced residue system modulo $m$. Then there is a value  $d_m$ such that if $\xi$ is any non-zero integer satisfying the bound
\[
4|\xi|\prod_{p\in R}|\xi|_p^2<d_m,
\]
there exists a prime $p\in R$ for which $\Lambda(F_p(\xi))\ne 0$.
\end{theorem}

\section{Preliminaries}

From Bennett et al.\ \cite{theta} and Davenport \cite[Ch.\ 20]{Davenport} we recall the estimates for the functions 
$$
\theta(x;m,a)=\sum_{\substack{p\equiv a \,(\text{mod}\ m)\\ p\in \mathbb{P},\  p\leq x}}\log p
$$ 
and 
$$
\psi(x;m,a)=\sum_{\substack{p^k\equiv a \,(\text{mod}\ m)\\ p\in \mathbb{P},\ p^k \leq x}}\log p.
$$ 

Very recently, Bennett, Martin, O'Bryant, and Rechnitzer \cite{theta} proved that if $q \in \mathbb{Z}_{\ge 3}$ and $a$ is an integer coprime to $q$, then there exist positive constants $c_{\theta}(q)$ and $x_{\theta} (q)$ such that 
\[
\left|\theta(x;q,a)-\frac{x}{\varphi(q)}\right|<c_{\theta}(q)\frac{x}{\log x}
\]
for all $x \ge x_\theta (q)$, and they even gave some values and bounds for these constants. It follows immediately that a similar bound holds for all $x\geq 2$ for some (not necessarily good) value of $c_{\theta}(q)$.

The error term can be substantially improved if we assume the generalized Riemann hypothesis. See, e.g., Davenport's book \cite[Ch.\ 20]{Davenport} for a good introduction into the topic. There one can also find the following useful bound: 
Assuming the GRH, we have 
\[
\psi(x;m,a)=\frac{x}{\varphi(m)}+O\left(\sqrt{x}\log^2x\right),
\]
where the $O$ term depends on $m$. Note that the second bound immediately gives the same bound for the function $\theta(x;q,a)$.

The following lemma may be known, but we state and prove it for the sake of completeness. The main term is clear by the distribution of primes in residue classes. The critical part is that the contribution coming from the other terms is not too large.

\begin{lemma}\label{lemma2}
Let $m\in\mathbb{Z}_{\ge 3}$ be a given integer and suppose $\gcd (a,m) =1$. Then
\[
\log \left(\prod_{p\equiv a \,(\text{\rm mod}\ m)} |n!|_p\right)=-\frac{n\log n}{\varphi(m)}+O(n\log \log n).
\]
Further, assuming the GRH, we obtain
\[
\log \left(\prod_{p\equiv a \,(\text{\rm mod}\ m)} |n!|_p\right)=-\frac{n\log n}{\varphi(m)}+O(n).
\]
\end{lemma}

\begin{proof} It is well known that $n!$ is divisible by a prime $p$ exactly $\sum_{k=1}^{\infty}\left\lfloor \frac{n}{p^k}\right\rfloor$ times. 
This term can be estimated in the following way (see, e.g., \cite{KTT}):
\[
\frac{n}{p-1}-\frac{\log n}{\log p}-1 \leq \sum_{k=1}^{\infty}\left\lfloor \frac{n}{p^k}\right\rfloor \leq \frac{n-1}{p-1}.
\]
Therefore, the $p$-adic valuation of $n!$ satisfies the bounds
\[
p^{-\frac{n}{p-1}}\leq |n!|_p\leq p^{-\frac{n}{p-1}+\frac{\log n}{\log p}+1}.
\]
Let us start by treating the contribution coming from the term $p^{-\frac{n}{p-1}}$. First use the Abel summation formula (see \cite[Theorem 4.2]{Apostol}):
\begin{equation}\label{Abel}
\begin{split}
&-\sum_{\substack{p\leq n \\ p\equiv a \,(\text{mod}\ m)}}\log p^{-\frac{n}{p-1}} \\
=\;&n\sum_{\substack{p\leq n \\ p\equiv a \,(\text{mod}\ m)}}\frac{\log p}{p-1}\\
=\;&\frac{n}{n-1} \sum_{\substack{p\leq n \\ p\equiv a \,(\text{mod}\ m)}} \log p + n\int_2^n \left(\sum_{\substack{p\leq x \\ p\equiv a \,(\text{mod}\ m)}} \log p \right)\cdot \frac{1}{(x-1)^2} \mathrm{d}x.
\end{split}
\end{equation}

Without assuming the GRH, this can be written as
\begin{align*}
&-\sum_{\substack{p\leq n \\ p\equiv a \,(\text{mod}\ m)}}\log p^{-\frac{n}{p-1}} \\
=\;&\frac{n}{n-1}\sum_{\substack{p\leq n \\ p\equiv a \,(\text{mod}\ m)}}\log p+n\int_2^n\left(\sum_{\substack{p\leq x \\ p\equiv a \,(\text{mod}\ m)}}\log p\right)\cdot \frac{1}{(x-1)^2}\mathrm{d}x\\
=\;&\frac{n}{n-1}\left(\frac{n}{\varphi(m)}+O\left(\frac{n}{\log n}\right)\right)+n\int_2^{n}\left(\frac{x}{\varphi(m)}+O\left(\frac{x}{\log x}\right)\right)\cdot \frac{1}{(x-1)^2}\mathrm{d}x\\
=\;&\frac{n}{\varphi(m)}+O\left(\frac{n}{\log n}\right)+\frac{n}{\varphi(m)}\int_2^n \frac{x\mathrm{d}x}{(x-1)^2}+O\left(n\int_2^n\frac{x\mathrm{d}x}{(x-1)^2\log x}\right)\\
=\;&\frac{n\log n}{\varphi(m)}+O(n)+ O \left( n\int_2^n\frac{(x-1)\mathrm{d}x}{(x-1)^2\log x}+n \int_2^n\frac{\mathrm{d}x}{(x-1)^2\log x} \right)\\
=\;&\frac{n\log n}{\varphi(m)}+O(n)+O \left( n\int_2^3\frac{\mathrm{d}x}{(x-1)\log x}+n \int_3^n\frac{\mathrm{d}x}{(x-1)\log x} \right).
\end{align*}
The last term can be estimated
\[
n\int_3^n\frac{\mathrm{d}x}{(x-1)\log x}\leq n\int_2^{n-1}\frac{\mathrm{d}x}{x\log x}=O(n\log \log n).
\]
Hence
\[
-\sum_{\substack{p\leq n \\ p\equiv a \,(\text{mod}\ m)}}\log p^{-\frac{n}{p-1}}=\frac{n\log n}{\varphi(m)}+O(n\log \log n).
\]

Assuming the GRH, \eqref{Abel} can be written as
\begin{align*}
&-\sum_{\substack{p\leq n \\ p\equiv a \,(\text{mod}\ m)}}\log p^{-\frac{n}{p-1}} \\
=\;&\frac{n}{n-1}\sum_{\substack{p\leq n \\ p\equiv a \,(\text{mod}\ m)}}\log p+n\int_2^n\left(\sum_{\substack{p\leq x \\ p\equiv a \,(\text{mod}\ m)}}\log p\right)\cdot \frac{1}{(x-1)^2}\mathrm{d}x\\ 
=\;&\frac{n}{n-1}\left(\frac{n}{\varphi(m)}+O\left(\sqrt{n}\log^2 n\right)\right)+n\int_2^{n}\left(\frac{x}{\varphi(m)}+O\left(\sqrt{x}\log^2x\right)\right)\cdot \frac{1}{(x-1)^2}\mathrm{d}x\\  
=\;&\frac{n}{\varphi(m)}+O\left(\sqrt{n}\log^2 n\right)+\frac{n}{\varphi(m)}\int_1^{n-1}\frac{\mathrm{d}x}{x}+\frac{n}{\varphi(m)}\int_1^{n-1}\frac{\mathrm{d}x}{x^2}+O(n)=\frac{n\log n}{\varphi(m)}+O(n).
\end{align*}

Let us now look at the term $p^{\log n/\log p+1}$:
\[
\sum_{\substack{p\leq n \\ p\equiv a \,(\text{mod}\ m)}}\log p^{\frac{\log n}{\log p}+1}
=\sum_{\substack{p\leq n \\ p\equiv a \,(\text{mod}\ m)}} (\log n+\log p)=O(n).
\]

Combining these, the contribution coming from all $p\equiv a \,(\text{mod}\ m)$ is
\[
\log\left(\prod_{\substack{p\leq n \\ p\equiv a \,(\text{mod}\ m)}} |n!|_p\right)=\sum_{\substack{p\leq n \\ p\equiv a \,(\text{mod}\ m)}}\log p^{-\frac{n}{p-1}+O\left(\frac{\log n}{\log p}+1\right)}=\frac{n\log n}{\varphi(m)}+O(n\log \log n),
\]
and assuming the generalized Riemann hypothesis, it will be
\[
\log\left(\prod_{\substack{p\leq n \\ p\equiv a \,(\text{mod}\ m)}} |n!|_p\right)=\sum_{\substack{p\leq n \\ p\equiv a \,(\text{mod}\ m)}}\log p^{-\frac{n}{p-1}+O\left(\frac{\log n}{\log p}+1\right)}=\frac{n\log n}{\varphi(m)}+O(n).
\]
\end{proof}



\section{Proofs of Theorems \ref{epatasa} and \ref{tasa}}


Let us first prove Theorem \ref{epatasa}.

\begin{proof}[Proof of Theorem \ref{epatasa}]
We shall use Theorem \ref{AB}.
By assumption, $R=\bigcup_{j=1}^r \left( \overline{h}_{i_j} \cap \mathbb{P} \right)$ is a union of the primes in $r$ residue classes 
$\overline{h}_{i_1}, \ldots, \overline{h}_{i_r}$ in the reduced residue system modulo $m$, where $r > \frac{\varphi(m)}{2}$. 
It suffices to prove that for any non-zero integer $\xi$ and a finite subset $S=\{p_1,\ldots,p_k\} \subseteq R$, the condition
\[
\lim\sup_{n\rightarrow \infty} c_0^{n}n! \prod_{p\in R\setminus S}|n!|_p^2=0, \quad c_0=4|\xi|\prod_{p\in R\setminus S}|\xi|_p^2,
\]
is satisfied. Thus we are led to study the expression
\begin{equation}\label{logeq}
\log \left(c_0^{n}n! \prod_{p\in R \setminus S}|n!|_p^2\right)=n\log c_0+\log n!+2\sum_{p\in R \setminus S} \log |n!|_p.
\end{equation}
Here
\begin{equation}\label{Ssumma}
2\sum_{p\in S}\log |n!|_p=2\sum_{i=1}^k\log |n!|_{p_i}=O(n)
\end{equation}
when $n$ grows for any given fixed $S$. The constant implied by the $O$-term may be arbitrarily large, but it is constant in the $n$ aspect.

Recall the Stirling formula (see, e.g., \cite[formula 6.1.38]{stirling}):
\[
\log n!=\log \sqrt{2\pi}+\left(n+\frac{1}{2}\right)\log n-n+\frac{\theta(n)}{12},
\]
where $0<\theta(n)<1$. The above can be further simplified to $\log n!=n\log n+O(n)$. Combining this with \eqref{logeq}, \eqref{Ssumma}, and Lemma \ref{lemma2}, we get
\begin{align*}
\log \left(c_0^{n}n! \prod_{p\in R\setminus S}|n!|_p^2\right)&=n\log n+O(n)+2\sum_{j=1}^r \sum_{p \in \overline{h}_{i_j}} \log |n!|_p - 2 \sum_{i=1}^k \log |n!|_{p_i}\\
&=n\log n+O(n)-\frac{2rn\log n}{\varphi(m)}+O(n\log \log n)\\
&=n\log n\left(1-\frac{2r}{\varphi(m)}\right)+O(n)+O(n\log \log n) \rightarrow -\infty
\end{align*}
as $n \to \infty$ because the coefficient $1-\frac{2r}{\varphi(n)}$ of the main term is negative.
The result follows from Theorem \ref{AB}.
\end{proof}

Let us now move to the proof of Theorem \ref{tasa}.
\begin{proof}[Proof of Theorem \ref{tasa}]
Here we use Proposition \ref{TAWA}, so we need to check condition \eqref{riistajaehto} with $c=4|\xi|\prod_{p\in R}|\xi|_p^2$. When looking at the terms in 
\[
\log \left(c^{n}n! \prod_{p\in R}|n!|_p^2\right)=n\log c+\log n!+2\sum_{p\in R} \log |n!|_p,
\]
we again use Stirling's formula and the bound for $|n!|_p$ as earlier. Now the main terms cancel, so what is left is $O(n)$ for some constant depending only on $m$. Therefore, the contribution of this term can be cancelled if $c$ is sufficiently small, namely, below some $d_m$ depending only on $m$.
\end{proof}
\begin{remark}
This proof of Theorem \ref{tasa} cannot be generalized to the case with infinitely many primes because the constant implied by the $O$-term in contribution of the arbitrary subset $S$ can be arbitrarily large, and therefore, we cannot use the argument of a term of magnitude $n$ cancelling the other terms.
\end{remark}


\section{Acknowledgments}

We wish to thank the referee for their careful reading of the manuscript and the valuable suggestion of adding Corollary \ref{corollary7}.


\begin{thebibliography}{99}

\bibitem{stirling} M. Abramowitz and I. A. Stegun, \emph{Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables}, National Bureau Of Standards Applied Mathematics Series, 55, Washington, D.C., 1964.

\bibitem{Apostol} T. M. Apostol, \emph{Introduction to Analytic Number Theory}, Springer, New York, 1976.

\bibitem{theta} M. A. Bennett, G.Martin, K. O'Bryant, and A. Rechnitzer, Explicit bounds for primes in arithmetic progressions. To appear in \emph{Illinois J. Math.} Available at \url{https://arxiv.org/abs/1802.00085}.

\bibitem{BCY04} D. Bertrand, V. G. Chirski\u \i , and J. Yebbou, Effective estimates for global relations on Euler-type series, \emph{Ann. Fac. Sci. Toulouse Math. (6)} \textbf{13} (2004), 241--260.

\bibitem{Chirskii1992} V. G. Chirski\u \i,  On algebraic relations in non-Archimedean fields, \emph{Funct. Anal. Appl.} \textbf{26} (1992), 108--115.

\bibitem{Chirskii2014} V. G. Chirski\u \i, On the arithmetic properties of generalized hypergeometric series with irrational parameters, \emph{Izv. Ross. Akad. Nauk Ser. Mat.} \textbf{78} (2014), 193--210;
English translation in \emph{Izv. Math.} \textbf{78} (2014), 1244--1260.

\bibitem{Chirskii2015} V. G. Chirski\u \i, Arithmetic properties of Euler series,\emph{Vestnik Moskov. Univ. Ser. I Mat. Mekh.} (2015), 59--61;
English translation in \emph{Moscow Univ. Math. Bull.} \textbf{70} (2015), 41--43.

\bibitem{Chirskii2017} V. G. Chirski\u\i, Arithmetic properties of polyadic series with periodic coefficients, \emph{Izv. Ross. Akad. Nauk Ser. Mat.} \textbf{81} (2017), 215--232; English translation in \emph{Izv. Math.} \textbf{81} (2017), 444--461.

\bibitem{Davenport} H. Davenport, \emph{Multiplicative Number Theory}, Springer-Verlag, New York, 2nd Edition, 1980.

\bibitem{KTT} K. Lepp\"al\"a, T. Matala-aho, and T. T\"orm\"a, Rational approximations of the exponential function at rational points, \emph{J. Number Theory} \textbf{179} (2017), 220--239.

\bibitem{TapaniWadim} T. Matala-aho and W. Zudilin, Euler's factorial series and global relations, \emph{J. Number Theory} \textbf{186} (2018), 202--210.

\end{thebibliography}


\bigskip
\hrule
\bigskip


\noindent 2010 {\it Mathematics Subject Classification}: 
Primary 11J61.

\noindent \emph{Keywords:} divergent series, global relation, $p$-adic number.

\bigskip
\hrule
\bigskip

\vspace*{+.1in}
\noindent
Received November 7 2018;
revised version received January 14 2019. 
Published in {\it Journal of Integer Sequences}, February 22 2019.

\bigskip
\hrule
\bigskip

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


\end{document}

                                                                                


.
