\section{Introduction}

Since the great success of the Standard Model in the recent decades, there has
been no doubt that the gauge theories are capable to describe the interactions
between elementary particles. With larger colliding energy available to probe
higher energy scattering events, only remained piece of the Standard Model,
Higgs boson(s), will be also discovered in the current and future colliders.
Besides, a new physics might be opened in this high energy frontier. Among
these energy scale, precise predictions by the perturbative calculations is
crucial for the signal and background estimations because their event
topologies become much complicate with increasing the colliding energy. We
have carried on the automatic computation of the Feynman diagrams by
GRACE \cite{grace} system since we immediately have a huge number of diagram
calculation in multi-particle final state processes although we can, in
principle, calculate them by hand based on their Lagrangian in perturbation
theory.

GRACE has satisfied this requirement at one-loop level \cite{grcloop} in the
electroweak interactions as well as at tree level and at the minimal
supersymmetric extension of the Standard Model (MSSM) \cite{grcmssm}. Those
development has been mostly aimed at applications to lepton collisions. The
generated codes however are not directly applicable to hadron-collision
interactions due to the presence of a parton distribution function (PDF).
Also, a certain process in hadron collisions consists of lots of subprocesses
by referring incoming partons in PDF or outgoing partons in jets. In current
scheme, it leads much time for the diagram calculations. We clearly need an
extended framework of the GRACE system for hadron collisions. Early extensions
can be seen in \cite{abe} and \cite{odaka}.

In order to implement those features specific to hadron collisions, we have
developed an extended framework, called GR@PPA (GRace At PP/Anti-p). The
primary function of GR@PPA is to determine the initial and final state
partons, $i.e.$ their flavors and momenta in the incoming partons by referring
to a PDF and the final state parton configuration if the process requires jets
or decay products from massive bosons. Based on the GRACE output codes, GR@PPA
calculates the cross section and generates unweighted parton-level events
using BASES/SPRING \cite{bases} included in the GRACE system. The GR@PPA
framework also includes an interface for a common data format (LHA)
\cite{leshouches} with the common interface routines proposed at Les Houches
Workshop on 2001\cite{tevwork}. To make the events realistic, the unweighted
event data are passed through the showering-MC of PYTHIA \cite{pythia} or
HERWIG \cite{herwig} which implements the initial- and final-state radiation,
hadronization and decays and so forth.

Although the GR@PPA framework is not process-specific and can be applied to
any other processes in hadron collisions using the output codes of the GRACE
system\footnote{The extension of GRACE itself to the hadron collisions is
under development.}, we also provide some primitive processes packed as a set
of matrix element customized for this extension. At the moment, the selected
processes are boson(s) plus n jets processes and $t\bar{t}$ plus m jets
processes, where n(m) is accounted for up to 4(1) jets. These processes are
the most important background processes for the Higgs boson searches or the
SUSY particle searches as well as the precise measurements for the
understandings of multi-body particle dynamics. Our previous work, four bottom
quark production processes (GR@PPA\_4b \cite{grappa_4b}), is also included.
The reasons why we also provide the particular processes apart from the
benefit of the automatic Feynman diagram calculation by the GRACE system are
followings. First, kinematical singularities in each process are cared with a
proper treatment. Since the kinematics are optimized to be suitable for
well-convergence behavior, one can get high efficiency to generate unweighted
events without any care. This is immediately addressed to the program running
speed which is critical for the large scale MC production. Second, it is easy
to adopt the higher order calculations. In higher order calculations, the
calculation procedure is normally process-specific. To avoid
the negative weight in cancellation between virtual and loop correction, one
requires the phase space points to be positive differential cross section.
This feature is so difficult to generalize by the automatic Feynman diagram
calculation. Once the customized matrix element for the NLO process is
prepared \cite{kuriharanlo}, one can simply use it. Third, some extensions are
possible only in the modification of the framework. For example, using an
ability of C++ language, the GR@PPA generators will work in the C++
environment just by rewriting the framework by C++ but the others are still
Fortran. This is minimum changes to wrap the Fortran code produced by the
GRACE system. The parton shower algorithm, for example NLL parton
shower \cite{nll}, is also possible to implement by modifying the framework
because the parton shower is not a process specific model. Note that the
extended GRACE system for hadron collisions will work to provide a set of
matrix elements apart from the GR@PPA framework at these point.

In this paper, we describe a symbolic treatment of the diagram calculation
adopted in GR@PPA for hadron collisions in the next section. Some benchmark
cross sections and program performances are presented in Section 3. Our
numerical results were compared with several
generators \cite{alpgen,madgraph,comphep,amegic}. We got a good agreement with
them \cite{mc4lhc2003}. Finally, a summary is given in Section 4.

\section{Extension of GRACE to $pp$/$p\bar{p}$ collisions}

In hadron-hadron collision, a certain process consists of several incoherent
subprocesses according to colliding partons in the hadrons. If the given
process has a decay or a jet in the final state, the whole possible
combinations of the outgoing partons are also taken into account for. The
total cross section is thus expressed as a simple summation of those
subprocesses in
Eq.(\ref{eq:xsec})
\begin{equation}
\sigma = \sum_{i, j, F} \int dx_{1} \int dx_{2} \int d\hat{\Phi}_{F}
f^{1}_{i}(x_{1},Q^{2}) f^{2}_{j}(x_{2},Q^{2})
{ d\hat{\sigma}_{i j \rightarrow F}(\hat{s}) \over d\hat{\Phi}_{F} },
\label{eq:xsec}
\end{equation}
where $f^{a}_{i}(x_{a},Q^{2})$ is a PDF of the hadron $a$ ($p$ or $\bar{p}$),
which gives the probability to find the parton $i$ with an energy fraction
$x_{a}$ at a probing virtuality of $Q^{2}$. The differential cross section
$d\hat{\sigma}_{i j \rightarrow F}(\hat{s})/d\hat{\Phi}_{F}$ describes the
parton-level hard interaction producing the final-state $F$ from a collision
of partons, $i$ and $j$, where $\hat{s}$ is the square of the total initial
4-momentum. The sum is taken over all relevant combinations of $i$, $j$ and
$F$. We had mainly two sorts of development in GR@PPA, --- applying PDF in the
phase space integration and sharing several subprocesses as a single
base-subprocess. The former is described in our previous
paper \cite{grappa_4b}. Here, we focus on the later case.

The original GRACE system assumes that both the initial and final states are
well-defined. Hence, it can be applied to evaluating
$d\hat{\sigma}_{i j \rightarrow F}(\hat{s})/d\hat{\Phi}_{F}$ and its
integration over the final-state phase space $\hat{\Phi}_{F}$ only. An
adequate extension is necessary to take into account the variation of the
initial and final states both in parton species and their momenta, in order to
make the GRACE system applicable to hadron collisions. As already mentioned, a
"process" of interest is usually composed of several incoherent subprocesses
in hadron interactions. However, in many cases, the difference between the
subprocesses is the difference in the quark combination in the initial and/or
final states only. The matrix element of these subprocesses is frequently
identical, or the difference is only in a few coupling parameters and/or
masses. In such cases, it is convenient to add one more
integration/differentiation variable to replace the summation in
Eq.(\ref{eq:xsec}) with an integration. As a result, these subprocesses can
share an identical "GRACE output code" and can be treated as a single
subprocess. This technique simplifies the program code and saves the computing
time very much.

The number of the combinations taken N out of M flavors allowing to overlap
them, in general, is given by
$_{M}H_{N}$($\equiv$ $\frac{(N+M-1)!}{N!(M-1)!}$). In case that all parton
flavors are considered,
$M=11(u,d,c,s,b,g,\bar{u},\bar{d},\bar{c},\bar{s},\bar{b})$, then the
configuration of the N jets final state has $_{11}H_{N}$ subprocesses if we
neglect the conservation by total amount of charges of this subprocess.
Clearly we can see that smaller $M$ decreases the number of subprocesses.
Unless the flavor difference is taken account in the process, the flavor
configurations can be replaced by a generic up-type, down-type parton, and
gluon ($_{5}H_{N}$ $\ll$ $_{11}H_{N}$). The base-subprocesses are thus
configured only as to have those partons and gluon. The output code of the
matrix element from the GRACE system is extended to have a function of input
masses and couplings, so that the masses and couplings are interchanged
according to the assigned flavors. Note that each base-subprocess covers every
possible combination of flavors. The diagram selection in the
base-subprocesses thus allows to specify all subprocesses with a proper flavor
configuration. In addition, since the Feynman diagrams within the process of
Standard Model are symmetry with respect to the momentum (parity) and charge
flip of the initial colliding partons in the CM frame of the process, the
subprocesses can be reduced more. In Table \ref{tab:subproc}, we list up the
number of all possible base-subprocesses contributes in N jets process in
$pp(\bar{p})$ collisions together with that of the subprocesses counted for
all flavor combinations. The subprocesses are classified according to the
difference in the initial-state parton combination. That is, the initial
parton combinations in the base-subprocesses are
$q_{u}q_{u}(\bar{q_{d}}\bar{q_{d}})$, $q_{u}\bar{q_{d}}$,
$q_{u}g(\bar{q_{d}}g)$, $q_{u}q_{d}$, $q_{u}\bar{q_{u}}(q_{d}\bar{q_{d}})$,
gg, where $q_{u}$($q_{d}$) and $g$ is up(down)-type quarks, and gluon,
respectively. We take them all positive side.

The integration of Eq.(\ref{eq:xsec}) has a weight factor for each subprocess.
If a decay products from the resonance particles is separately taken account
for the final state partons of N jets configuration, Eq.(\ref{eq:xsec2}) can
be rewritten as
\begin{equation}
\sigma = \int dw_{i,j,F} \int dx_{1} \int dx_{2} \int d\hat{\Phi}_{F}
w_{i,j,F} \cdot \frac{d\hat{\sigma}_{i j \rightarrow F}^{selected}
(\hat{s};m,\alpha)}{d\hat{\Phi}_{F}} ,
\label{eq:xsec2}
\end{equation}
where $d\hat{\sigma}_{i j \rightarrow F}^{selected}$ is the differential cross
section of each subprocess with an input arguments of the masses and
couplings. The matrix element is supplied by that of the base-subprocess.
Based on the initial and final state parton configuration, the graph selection
is applied to this base-subprocess, and masses and couplings are given in the
diagram calculation event by event. The $w_{i,j,F}$ is a weight factor for the
initial and final state parton configuration, and can be expressed as
\begin{equation}
w_{i,j,F} = \sum_{i,j,F} f^{1}_{i}(x_{1},Q^{2}) f^{2}_{j}(x_{2},Q^{2})
\cdot |V_{CKM}|^{2K} \cdot
\{Br.(X \rightarrow F') \times \Gamma_{tot}^{X}\}^{L} ,
\label{eq:xsec3}
\end{equation}
where an index $K$ and $L$ is the number of W and $X$ bosons, respectively. A
PDF is responsible for the weight of the initial state parton configuration,
and a squared coupling normalized by that of the base-subprocess is
responsible for the weight of the final state parton configuration. Note that
the square of the CKM (Cabibbo-Kobayashi-Maskawa) \cite{ckm} matrix parameter
remains after normalization of the coupling of the base-subprocess depending
on the number of the W bosons $K$. If the $X$ boson presents in the Feynman
diagrams and decay into $F'$ without interference with the other partons,
where $F'$ is a member of the final state particles, then the fraction of the
decay is used as the weight factor. The branching ratio and total width may be
given by the experimental measured one.

\section{Results}

The total cross sections estimated by GR@PPA are presented in
Table \ref{tab:xsecsgl} for the single boson plus jets productions and
Table \ref{tab:xsecdbl} for the double bosons plus jets productions,
respectively, where all bosons decay into electron and positron ($e^{+}e^{-}$)
or electron(positron) and (anti-)electron-neutrino ($e\nu_{e}$). Both are
shown with the cases of Tevatron Run-II ($p\bar{p}$ collisions at $\sqrt{s}$
$=$ 1.96 TeV) and LHC ($pp$ collisions at $\sqrt{s}$ $=$ 14 TeV) conditions
with CTEQ5L \cite{cteq} PDF. The renormalization and factorization scales
($Q^{2}$) are chosen to be identical, and those values are taken as the
squared boson mass for the single boson productions and the summation of
squared boson masses for the double bosons productions processes. The cuts are
only applied for the final state partons (jets), with the values of
$p_{T}$ $>$ 8.0 GeV, $|\eta|$ $<$ 3.0, and $\Delta$R $>$ 0.4 for Tevatron, and
$p_{T}$ $>$ 20 GeV, $|\eta|$ $<$ 3.0, and $\Delta$R $>$ 0.4 for LHC
conditions, but no cut is applied for leptons from bosons. The integration
accuracy achieved in BASES is fairly better than 1\% for all processes with
the default settings of the mapping number for the integrations.

The performance of GR@PPA for the W + N jets processes in Tevatron Run-II
condition is also summarized in Table \ref{tab:xsecspeed}. Used processor is
Intel Xeon 3.4 GHz processor. Tests are performed by two different Fortran
compilers: a free software of g77 ver.2.96 and a commercial compiler of Intel
Fortran Compiler ver.8.0. The integration time and the generation speed are
separately shown. Clearly, the commercial compiler is $\sim$ 2.5 faster than
the free compiler, but in both cases, those are not intolerable time for the
large scale Monte Carlo production. The generation efficiencies by SPRING are
also shown. These are within an order of a few percent for most of the
processes. These numbers are exceptionally good for this kind of complicated
processes.

\section{Summary}

We have developed an extended framework, named GR@PPA, of the GRACE system for
hadron collisions. We have introduced the scheme to share some subprocesses as
a single subprocess. We found that this extension allows us to incorporate the
variation in the initial and final states parton configurations into the GRACE
system. The results for some processes with multi-parton configurations are
presented, and we found that the computing time for the diagram calculations
is drastically reduced to be compared with the original GRACE system which
assumes that both the initial and final states are well-defined and the
integration is performed for every each subprocess. Using this faculty of
GR@PPA, we expect that the event generator is suitable not only for a large
scale Monte Carlo production at high luminosity hadron colliders of Tevatron
or LHC, but also for future NLO calculations which is also composed of lots
of subprocesses.

\section{Acknowledgements}

The author would like to thank all the people of the Minami-Tateya numerical
calculation group and the ATLAS-Japan Collaboration. The author would also
like to thank the organizers of the Conference.


\section{The result}

\subsection{}

Let us remind the theorem of H. Bohr (see \cite{5}, p. 253, Theorem 11.6(C)): The function $\zeta(s)$ attains every value $a\in\mbb{C}$ except
$0$ infinitely many times in the strip $a<\sigma<1+\delta$. At the same time, this theorem does not allow us to prove anything about the set of the
roots of the equation
\bdis
|\zeta(\sigma_0+it)|=|a|,\ \sigma_0\in (1,1+\delta) ,
\edis
i.e. about the roots lying on every fixed line $\sigma=\sigma_0$. \\

In this paper we will study more complicated nonlinear equation

\be \label{1.1}
\left|\zeta\left(\frac 12+iu\right)\right|^2\left|\zeta\left(\frac 12+iv\right)\right|^2=\frac 12\zeta(2\sigma)\ln u,\ u,v>0,\ \sigma\geq\alpha>1
\ee
where $\alpha$ is an arbitrary fixed value.

\begin{remark}
The theory of H. Bohr is not applicable on the equation (\ref{1.1}). However, by the method of Jacob's ladders we obtain some information about the set
of approximative solutions of this equation.
\end{remark}

\subsection{}

Let us remind that

\be \label{1.2}
\tilde{Z}^2(t)=\frac{{\rm d}\vp_1(t)}{{\rm d}t},\ \vp_1(t)=\frac 12\vp(t)
\ee

where

\be \label{1.3}
\tilde{Z}^2(t)=\frac{Z^2(t)}{2\Phi'_\vp[\vp(t)]}=\frac{Z^2(t)}{\left\{ 1+\mcal{O}\left(\frac{\ln\ln t}{\ln t}\right)\right\}\ln t} ,
\ee
(see \cite{1}, (3.9); \cite{2}, (1.3); \cite{4}, (1.1), (3.1)), and $\vp(t)$ is the solution of the nonlinear integral equation

\bdis
\int_0^{\mu[x(T)]}Z^2(t)e^{-\frac{2}{x(T)}t}{\rm d}t=\int_0^TZ^2(t){\rm d}t .
\edis

\subsection{}

\begin{mydef2}
If there are some sequences $\{ u_n(\sigma_0)\}_{n=0}^\infty,\ \{ v_n(\sigma_0)\}_{n=0}^\infty,\ \sigma_0>1$ for which the following condition
are fulfilled
\be \label{eqA}
\lim_{n\to\infty} u_n(\sigma_0)=\infty,\ \lim_{n\to\infty}v_n=\infty , \tag{A}
\ee
\be \label{eqB}
\frac{\left|\zeta\left(\frac 12+iu_n(\sigma_0)\right)\right|^2\left|\zeta\left(\sigma_0+iv_n(\sigma_0)\right)\right|^2}
{\zeta(2\sigma_0)\ln u_n(\sigma_0)}=\frac 12+o(1) , \tag{B}
\ee
then we call each ordered pair $[u_n(\sigma_0),v_n(\sigma_0)]$ an \emph{asymptotically approximate solution} (AA solution) of the nonlinear
equation (\ref{1.1}).
\end{mydef2}

The following theorem holds true.

\begin{mydef1}
Let us define the continuum set of sequences
\bdis
\{ K_n(T)\}_{n=0}^\infty,\ K_n\geq T_0[\vp_1]
\edis
as follows
\be \label{1.4}
\begin{split}
& K_0=T,\ K_1=K_0+K_0^{1/3+2\epsilon},\ K_2=K_1+K_1^{1/3+2\epsilon}, \dots , \\
& K_{n+1}=K_n+K_n^{1/3+2\epsilon} , \dots \ .
\end{split}
\ee
Then for every $\sigma_0:\ \sigma_0\geq \alpha>1$ there is a sequence $\{ u_n(\sigma_0)\}_{n=0}^\infty,\ u_n(\sigma_0)\in (K_n,K_{n+1})$ such that
\be \label{1.5}
\frac{\left|\zeta\left(\frac 12+iu_n(\sigma_0)\right)\right|^2\left|\zeta\left(\sigma_0+i\vp_1[u_n(\sigma_0)]\right)\right|^2}
{\zeta(2\sigma_0)\ln u_n(\sigma_0)}=\frac 12+\mcal{O}\left(\frac{\ln\ln K_n}{\ln K_n}\right) .
\ee
holds true where $\vp_1[u_n(\sigma_0)]\in (\vp_1(K_n),\vp_1(K_{n+1}))$ and
\be \label{1.6}
\rho\{[K_n,K_{n+1}];[\vp_1(K_n),\vp_1(K_{n+1})]\}\sim (1-c)\pi(K_n)\to\infty
\ee
as $n\to\infty$ where $\rho$ denotes the distance of the segments, $c$ is the Euler's constant and $\pi(t)$ is the prime-counting function, i.e. the
ordered pair
\bdis
[u_n(\sigma_0),\vp_1[u_n(\sigma_0)]]; \ \vp_1[u_n(\sigma_0)]=v_n(\sigma_0)
\edis
is the AA solution of the nonlinear equation (\ref{1.1}).
\end{mydef1}

\begin{remark}
Let us point out that the formula (\ref{1.5}) binds together the values of $\zeta(s)$ at three distinct points: at the point $\frac 12+iu_n(\sigma_0)$
lying on the critical line $\sigma=\frac 12$, and at the points $\sigma_0+i\vp_1[u_n(\sigma_0)],2\sigma_0$ lying in the semi-plane
$\sigma\geq\alpha>1$ .
\end{remark}

\begin{remark}
Since by the eq. (\ref{1.5}) we have
\be \label{1.6}
\left|\zeta\left(\frac 12+iu_n(\sigma_0)\right)\right|^2\sim \frac{\zeta(2\sigma_0)\ln u_n(\sigma_0)}{2}\frac{1}
{\left|\zeta\left(\sigma_0+i\vp_1[u_n(\sigma_0)]\right)\right|^2} ,
\ee
\be \label{1.7}
\left|\zeta\left(\sigma_0+i\vp_1[u_n(\sigma_0)]\right)\right|^2\sim \frac{\zeta(2\sigma_0)\ln u_n(\sigma_0)}{2}\frac{1}
{\left|\zeta\left(\frac 12+iu_n(\sigma_0)\right)\right|^2} ,
\ee
then for the two parallel conductors placed at the positions of the lines $\sigma=\frac 12$ and $\sigma=\sigma_0\geq \alpha>1$ some art of the
Faraday law holds true: the sequence of the energies $\{|\zeta(\sigma_0+i\vp_1[u_n(\sigma_0)])|^2\}_{n=0}^\infty$ on $\sigma=\sigma_0$ generates
the sequence of the energies $\{|\zeta(\frac 12+iu_n(\sigma_0))|^2\}_{n=0}^\infty$ on $\sigma=\frac 12$, and vice versa (see (\ref{1.6}), (\ref{1.7});
the energy is proportional to the square of the amplitude of oscillations).
\end{remark}

\section{The local mean-value theorem}

\subsection{}

Let us remind that there is the \emph{global} mean-value theorem (see \cite{5}, p. 116)

\bdis
\lim_{T\to\infty}\frac{1}{2T}\int_{-T}^T |\zeta(\sigma+it)|^2{\rm d}t=\zeta(2\sigma),\ \sigma>1 .
\edis

However, for our purpose, we need the \emph{local} mean-value theorem, i.e. the formula for the the integral

\bdis
\int_T^{T+U}|\zeta(\sigma+it)|^2{\rm d}t ,\ \sigma>1 .
\edis

In this direction, the following lemma holds true.

\begin{mydef5}
The formula
\be \label{2.1}
\int_T^{T+U}|\zeta(\sigma+it)|^2{\rm d}t=\zeta(2\sigma)U+\mcal{O}(1)
\ee
holds true uniformly for $T,U>0,\ \sigma\geq\alpha$, where $\alpha>1$ is an arbitrary fixed value. The $\mcal{O}$-constant depends of course on the choice
of $\alpha$.
\end{mydef5}

\begin{remark}
The formula (\ref{2.1}) is the asymptotic formula for $U\geq \ln\ln T$, for example.
\end{remark}

\subsection{Proof of the Lemma}

Following the formula

\bdis
\zeta(s)=\zeta(\sigma+it)=\sum_{n=1}^\infty \frac{1}{n^{\sigma+it}}, \ \sigma>1
\edis

we obtain

\bdis
|\zeta(\sigma+it)|^2=\zeta(2\sigma)+\sum_n\sum_{m\not=n}\frac{1}{(mn)^\sigma}\cos\left( t\ln\frac nm\right) ,
\edis
and
\be \label{2.2}
\begin{split}
& \int_T^{T+U}|\zeta(\sigma+it)|^2{\rm d}t=\zeta(2\sigma)U+\mcal{O}\left(\sum_{n}\sum_{m<n}\frac{1}{(mn)^\sigma\ln\frac nm}\right)= \\
& = \zeta(2\sigma)U+S(m<n)
\end{split}
\ee
uniformly for $T,U>0$. Let

\be \label{2.3}
S(m<n)=S\left( m<\frac n2\right)+S\left( \frac n2\leq m<n\right)=S_1+S_2 .
\ee

Since we have $2<\frac nm$ in $S_1$, and
\bdis
\sum_{n=1}^\infty\frac{1}{n^\sigma}=1+\sum_{n=2}^\infty \frac{1}{n^\sigma}<1+\int_1^\infty x^{-\sigma}{\rm d}x=1+\frac{1}{\sigma-1}
\edis
then
\be \label{2.4}
S_1=\mcal{O}\left(\sum_n\sum_{m<\frac n2}\frac{1}{(mn)^\sigma}\right)=\mcal{O}\left\{\left(\sum_{n=1}^\infty\frac{1}{n^\sigma}\right)^2\right\}=
\mcal{O}(1) .
\ee

We put $m=n-r>\frac n2;\ 1\leq r<\frac n2$ in $S_2$ and we obtain as usual
\bdis
\ln\frac nm=\ln\frac{n}{n-r}=-\ln\left( 1-\frac rn\right)>\frac rn .
\edis
Next, we have
\bdis
\begin{split}
& \sum_{n=2}^\infty \frac{\ln n}{n^{2\sigma-1}}=\frac{\ln 2}{2^{2\sigma-1}}+\sum_{n=3}^\infty \frac{\ln n}{n^{2\sigma-1}}<
\frac{\ln 2}{2^{2\sigma-1}}+\int_2^\infty\frac{\ln x}{x^{2\sigma-1}}{\rm d}x= \\
& =\frac{\ln 2}{2^{2\sigma-1}}+\frac{2^{-2\sigma+1}}{\sigma-1}\ln 2+\frac{2^{-2\sigma}}{(\sigma-1)^2}=\mcal{O}(1);\ 2^{-\sigma}\in \left( 0,\frac 12\right) .
\end{split}
\edis
Then
\be \label{2.5}
S_2=\mcal{O}\left(\sum_n\sum_{r=1}^{n/2}\frac{n}{(mn)^\sigma r}\right)=\mcal{O}\left( 2^\sigma\sum_{n=2}^\infty \frac{\ln n}{n^{2\sigma-1}}\right)=\mcal{O}(1) .
\ee
Finally, from (\ref{2.2}) by (\ref{2.3})-(\ref{2.5}) the formula (\ref{2.1}) follows.

\section{Proof of the Theorem}

\subsection{}

Let us remind that the following lemma holds true (see \cite{3}, (2.5);\cite{4}, (3.3)): for every integrable function (in the Lebesgue sense)
$f(x),\ x\in [\vp_1(T),\vp_1(T+U)]$ the following is true
\be \label{3.1}
\int_T^{T+U}f[\vp_1(t)]\tilde{Z}^2(t){\rm d}t=\int_{\vp_1(T)}^{\vp_1(T+U)}f(x){\rm d}x ,\ U\in \left(\left. 0,\frac{T}{\ln T}\right]\right. ,
\ee
where $t-\vp_1(t)\sim (1-c)\pi(t)$.

\subsection{}

In the case $f(t)=|\zeta(\sigma_0+it)|^2,\ U=U_0=T^{1/3+2\epsilon}$ we obtain from (\ref{3.1}) the following formula

\be \label{3.2}
\int_T^{T+U_0}|\zeta(\sigma_0+i\vp_1(t))|^2\tilde{Z}^2(t){\rm d}t=\int_{\vp_1(T)}^{\vp_1(T+U_0)}|\zeta(\sigma_0+it)|^2{\rm d}t .
\ee
Since (see (\ref{2.1}))
\be \label{3.3}
\begin{split}
& \int_{\vp_1(T)}^{\vp_1(T+U_0)}|\zeta(\sigma_0+it)|^2{\rm d}t=\zeta(2\sigma_0)\{\vp_1(T+U_0)-\vp_1(T)\}+\mcal{O}(1)= \\
& =\frac 12\zeta(2\sigma_0)U_0\tan[\alpha(T,U_0)]+\mcal{O}(1)
\end{split}
\ee
where (see (\ref{1.2}))
\bdis
\frac{\vp_1(T+U_0)-\vp_1(T)}{U_0}=\frac 12\frac{\vp(T+U_0)-\vp(T)}{U_0}=\frac 12\tan[\alpha(T,U_0)] ,
\edis
and (see \cite{3}, (2.6))
\bdis
\tan[\alpha(T,U_0)]=1+\mcal{O}\left(\frac{1}{\ln T}\right) ,
\edis
then (see (\ref{3.3}))
\be \label{3.4}
\int_{\vp_1(T)}^{\vp_1(T+U_0)}|\zeta(\sigma_0+it)|^2{\rm d}t=\frac 12\zeta(2\sigma_0)U_0\left\{ 1+\mcal{O}\left(\frac{1}{\ln T}\right)\right\} .
\ee

\subsection{}

Next, by the first application of the mean-value theorem we obtain (see (\ref{1.3}), (\ref{3.2}))

\be \label{3.5}
\begin{split}
& \int_T^{T+U_0}|\zeta(\sigma_0+i\vp_1(t))|^2\tilde{Z}^2(t){\rm d}t= \\
& =\frac{1}{\left\{ 1+\mcal{O}\left(\frac{\ln\ln\xi_1}{\ln \xi_1}\right)\right\}\ln\xi_1}
\int_T^{T+U_0}|\zeta(\sigma_0+i\vp_1(t))|^2\left|\zf\right|^2{\rm d}t , \\
& \xi_1=\xi_1(\sigma_0;T,U_0)\in (T,T+U_0) ,
\end{split}
\ee
and by the second application of this we obtain

\be \label{3.6}
\begin{split}
& \int_T^{T+U_0}|\zeta(\sigma_0+i\vp_1(t))|^2\left|\zf\right|^2{\rm d}t= \\
& =|\zeta(\sigma_0+i\vp_1(\xi_2))|^2
\left|\zeta\left(\frac 12+i\xi_2\right)\right|^2U_0 , \\
& \xi_2=\xi_2(\sigma_0;T,U_0)\in (T,T+U_0),\ \vp_1(\xi_2)\in (\vp_1(T),\vp_1(T+U));\\
& \ln\xi_1\sim\ln\xi_2 .
\end{split}
\ee

Hence, from (\ref{3.5}) by (\ref{3.6}) we have

\be \label{3.7}
\int_T^{T+U_0}|\zeta(\sigma_0+i\vp_1(t))|^2\tilde{Z}^2(t){\rm d}t=
\frac{|\zeta(\sigma_0+i\vp_1(\xi_2))|^2\left|\zeta\left(\frac 12+i\xi_2\right)\right|^2}
{\left\{ 1+\mcal{O}\left(\frac{\ln\ln\xi_2}{\ln \xi_2}\right)\right\}\ln\xi_2}U_0 ,
\ee
and from (\ref{3.2}) by (\ref{3.4}), (\ref{3.7}) we obtain

\be \label{3.8}
\frac{|\zeta(\sigma_0+i\vp_1(\xi_2))|^2\left|\zeta\left(\frac 12+i\xi_2\right)\right|^2}{\zeta(2\sigma_0)\ln\xi_2}=
\frac 12+\mcal{O}\left(\frac{\ln\ln\xi_2}{\ln\xi_2}\right) .
\ee

\subsection{}

Now, if we apply (\ref{3.8}) in the case (see (\ref{1.4}))

\bdis
\begin{split}
& [T,T+U_0]\to [K_n,K_{n+1}];\ \xi_2(\sigma_0)\to\xi_{2,n}(\sigma_0)\in (K_n,K_{n+1}); \\
& \xi_{2,n}(\sigma_0)=u_n(\sigma_0) ,
\end{split}
\edis
then we obtain (\ref{1.5}). The statement (\ref{1.6}) follows from $t-\vp_1(t)\sim (1-c)\pi(t)$.

\section{Concluding remarks}

Let us remind that in \cite{1} we have shown the following formula holds true

\bdis
\int_0^T Z^2(t){\rm d}t=\vp_1(T)\ln\vp_1(T)+(c-\ln 2\pi)\vp_1(T)+c_0+\mcal{O}\left(\frac{\ln T}{T}\right),\ \vp_1(T)=\frac{\vp(T)}{2} ,
\edis
where $\vp_1(T)$ is the Jacob's ladder. It is clear that $\vp_1(T)$ is the asymptotic solution of the nonlinear transcendental equation
\bdis
\int_0^T Z^2(t){\rm d}t=V(T)\ln V(T)+(c-\ln 2\pi)V(T) .
\edis


\section{Introduction}
\label{Intro}

\subsection{The classical case}

The $n$-th Bernoulli polynomial $B_n(x)$
 is  implicitly defined as the coefficient of
$t^n$ in the generating function
\begin{equation*}
\frac{te^{xt}}{e^t-1}=\sum_{n=0}^{\infty}B_{n}(x) \frac{t^n}{n!},
\end{equation*}
where $e$ is the base of the natural logarithm.
For $n\ge 0$ the Bernoulli numbers $B_n$ are defined by
$B_{n}=B_{n}(0).$
It is well-known that $B_0=1$, and $B_n = 0$ for every odd integer $n > 1$.

In this paper, $p$ always denotes a prime.
An odd prime $p$ is said to be \textit{B-irregular}
if $p$ divides the numerator of at least one of the Bernoulli numbers $B_{2},B_{4},\ldots,B_{p-3}$,
and \textit{B-regular} otherwise.
The first twenty B-irregular primes are
\begin{align*}
& 37, 59, 67, 101, 103, 131, 149, 157, 233, 257, 263,  \\
& 271,  283, 293, 307, 311, 347, 353, 379, 389.
\end{align*}

The notion of B-irregularity has an important application in algebraic number theory. Let $\mathbb{Q}(\zeta_{p})$ be the $p$-th cyclotomic field,
and $h_p$ its class number.
Denote by $h_p^{+}$ the class number of $\Q(\zeta_p+\zeta_p^{-1})$ and
put
$h_p^{-}=h_p / h_p^{+}.$
Kummer proved that $h_p^{-}$ is an integer
 (now called the \textit{relative class number} of $\Q(\zeta_p)$)
and gave the following characterization (see \cite[Theorem 5.16]{Wa}).
(Here and in the sequel, for any integer $n \ge 1$, $\zeta_n$ denotes an $n$-th primitive root of unity.)

\begin{theorem}[Kummer]
\label{thm:Kummer}
An odd prime $p$ is B-irregular if and only if $p\mid h_{p}^{-}$.
\end{theorem}
Kummer showed that if $p\nmid h_p^{-},$ then
the Diophantine equation $x^p+y^p=z^p$ does not have an integer solution
$x,y,z$ with $p$ coprime to $xyz,$ cf. \cite[Chapter 1]{Wa}.

We remark that for any odd prime $p$, $p\mid h_{p}^{-}$ if and only if $p\mid h_{p}$; see \cite[Theorem 5.34]{Wa}. The class number $h_{p}^{+}$ is rather more
elusive than $h_{p}^{-}$. Here Vandiver
made the conjecture that $p\nmid h_{p}^{+}$ for any odd prime $p$.

Jensen \cite{Jensen} was the
first to prove that there are infinitely many B-irregular primes.
More precisely, he showed that there are infinitely many B-irregular primes
not of the form $4n + 1$.
This was generalized by Montgomery \cite{Mon},
who showed that  4 can be replaced by any integer greater than 2.
To the best of our knowledge,
the following result due to Mets\"ankyl\"a \cite{Met2} has not been
improved upon.

\begin{theorem}[Mets\"ankyl\"a \cite{Met2}]
\label{thm:Met}
Given an integer $m>2$, let $\Z_m^*$ be the multiplicative group of the residue classes modulo $m$, and let $H$ be a proper subgroup of $\Z_m^*$.
Then, there exist infinitely many B-irregular primes not lying in the residue classes in $H$.
\end{theorem}

Let ${\mathcal P}_B$ be the set of B-irregular primes.
Carlitz \cite{Carlitz} gave a simple proof of
the infinitude of this set,
and recently Luca, Pizarro-Madariaga and Pomerance \cite[Theorem 1]{Luca} made this more quantitative by showing that
\begin{equation}
\label{eq:Luca}
{\mathcal P}_B(x)  \ge (1+o(1)) \frac{\log\log x}{\log\log\log x}
\end{equation}
as $x \to \infty$. (Here and in the sequel, if
$S$ is a set of natural numbers, then $S(x)$ denotes
the number of elements in $S$ not exceeding $x.$)
Heuristical arguments suggest a much stronger
result (consistent with numerical data; see, for instance, \cite{BH,HHO}).

\begin{conjecture}[Siegel \cite{Siegel}]   \label{conj:Siegel1}
Asymptotically we have
 $$
 \cP_B(x)\sim \left( 1-\frac{1}{\sqrt{e}}\right) \pi(x),
 $$
 where $\pi(x)$ denotes the prime counting function.
 \end{conjecture}

The reasoning behind this conjecture is as follows.
We assume that the numerator of $B_{2k}$ is not divisible
by $p$ with probability $1-1/p.$ Therefore, assuming the
independence of divisibility by distinct primes, we expect
that $p$ is B-regular with probability
$$
\left( 1-\frac{1}{p}\right)^{\frac{p-3}{2}},
$$
which with increasing $p$ tends to $e^{-1/2}$.

For any positive integers $a,d$ with $\gcd(a,d)=1$, let $\cP_B(d,a)$
be the set of B-irregular primes congruent to $a$ modulo $d$.
We pose the following conjecture,
which suggests that B-irregular primes are uniformly distributed in arithmetic progressions.
It is consistent with numerical data; see Table \ref{tab:B-irre}.

\begin{conjecture}  \label{conj:Siegel2}
For any positive integers $a,d$ with $\gcd(a,d)=1$, asymptotically we have
 $$
 \cP_B(d,a)(x)\sim \frac{1}{\varphi(d)} \left(1-\frac{1}{\sqrt{e}}\right) \pi(x),
 $$
 where $\varphi$ denotes Euler's totient function.
\end{conjecture}

Although we know that there are infinitely many
 B-irregular primes, it is still not known whether
 there are infinitely many B-regular primes!

\subsection{Some generalizations}

In \cite{Carlitz} Carlitz studied (ir)regularity with respect to Euler numbers.

The Euler numbers $E_n$ are a sequence  of integers defined by the relation
$$
\frac{2}{e^t+e^{-t}} = \sum_{n=0}^{\infty} E_n \frac{t^n}{n!}.
$$
It is easy to see
that $E_0=1$, and $E_n=0$ for any odd $n\ge 1$.
Euler numbers, just as Bernoulli numbers, can be defined via special polynomial values.
The Euler polynomials $E_{n}(x)$ are implicitly defined as the coefficient of
$t^n$ in the generating function
\begin{equation*}  \label{Eu-pol}
\frac{2e^{xt}}{e^t+1}=\sum_{n=0}^\infty E_n(x)\frac{t^n}{n!}.
\end{equation*}
Then, $E_n = 2^n E_n(1/2), n=0,1,2,\ldots.$

An odd prime $p$ is said to be \textit{E-irregular}
if it divides at least one of the integers  $E_{2},E_{4},\ldots,E_{p-3}$,
and \textit{E-regular} otherwise.
The first twenty E-irregular primes are
\begin{align*}
& 19, 31, 43, 47, 61, 67, 71, 79, 101, 137, 139, \\
& 149, 193, 223, 241, 251, 263, 277, 307, 311.
\end{align*}
Vandiver \cite{Van} proved that if $p$ is E-regular, then
the Diophantine equation $x^p+y^p=z^p$ does not have an integer solution
$x,y,z$ with $p$ coprime to $xyz.$
This criterion makes it possible to discard
many of the exponents Kummer could not handle:
$$
37, 59, 103, 131, 157, 233, 257, 271, 283, 293,\ldots.
$$

Carlitz \cite{Carlitz} showed that there are infinitely many E-irregular primes.
Luca, Pizarro-Madariaga and Pomerance in \cite[Theorem 2]{Luca}
showed that the number of  E-irregular primes up to
$x$ satisfies the same lower bound as in \eqref{eq:Luca}.
Regarding their distribution, we currently only know that there are infinitely many E-irregular primes
not lying in the residue classes $\pm 1~({\rm mod~}8)$, which was proven by Ernvall \cite{Ern}.

Like the B-(ir)regularity of primes, their E-(ir)regularity also relates to the
divisibility of class numbers of cyclotomic fields; see \cite{Ern2,Ern3}.

Let $\cP_E$ be the set of E-irregular primes, and let $\cP_E(d,a)$
be the set of E-irregular primes congruent to $a$ modulo $d$.
It was conjectured and tested in \cite[Section 2]{EM} that:

\begin{conjecture}  \label{conj:E-irre1}
Asymptotically we have
 $$
 \cP_E(x)\sim \left(1-\frac{1}{\sqrt{e}}\right)\pi(x).
 $$
 \end{conjecture}

As in the case of B-irregular primes, we pose the following conjecture.

\begin{conjecture}  \label{conj:E-irre2}
 For any positive integers $a,d$ with $\gcd(a,d)=1$, asymptotically we have
 $$
 \cP_E(d,a)(x)\sim \frac{1}{\varphi(d)} \left(1-\frac{1}{\sqrt{e}}\right)\pi(x).
 $$
 \end{conjecture}
\noindent This conjecture is consistent with computer
calculations;
see Table \ref{tab:E-irre}.

Later on, Ernvall \cite{Ern2,Ern3} introduced $\chi$-irregular primes
and proved the infinitude of such irregular primes for any Dirichlet character $\chi$,
including B-irregular primes and E-irregular primes as special cases.
In addition, Hao and Parry \cite{HP} defined $m$-regular primes for any square-free integer $m$,
and Holden \cite{Holden} defined irregular primes by using the values of zeta functions of
totally real number fields.

In this paper, we
introduce a new kind of irregular prime based on Genocchi
numbers and study
their distribution in
detail.

\subsection{Regularity with respect to Genocchi numbers}
\label{sec:Euler}

The Genocchi numbers $G_n$ are defined by the relation
$$
\frac{2t}{e^t+1} = \sum_{n=1}^{\infty} G_n \frac{t^n}{n!}.
$$
It is well-known that $G_1=1$, $G_{2n+1}=0$ for $n \ge 1$, and $(-1)^nG_{2n}$ is an odd positive integer.
The Genocchi numbers $G_n$ are related to Bernoulli numbers $B_n$ by the formula
\begin{equation}  \label{eq:BnGn}
G_n = 2(1-2^n)B_n.
\end{equation}
In view of the definitions of $G_n$ and $E_n(x)$, we directly obtain
\begin{equation}  \label{eq:EnGn}
G_n = nE_{n-1}(0), \quad n \ge 1.
\end{equation}

In analogy with Kummer and Carlitz, we here define an odd prime $p$ to be \textit{G-irregular}
if it divides at least one of the integers $G_2,G_4,\ldots, G_{p-3}$, and
\textit{G-regular} if it does not.
The first twenty G-irregular primes are
\begin{align*}
& 17, 31, 37, 41, 43, 59, 67, 73, 89, 97, 101, 103, \\
& 109, 113, 127, 131, 137, 149, 151, 157.
\end{align*}
Clearly, if an odd prime $p$ is B-irregular, then it is also G-irregular.

Recall that a \textit{Wieferich prime} is an odd prime $p$ such that
$2^{p-1}\equiv 1~({\rm mod~}p^2)$, which arose in the study of Fermat's Last Theorem.
So, if an odd prime $p$ is a Wieferich prime, then $p$ divides $G_{p-1}$,
and otherwise it does not divide $G_{p-1}$.
Currently there are only two Wieferich prime known, namely
$1093$ and $3511$.
If there are further ones, they are larger than $6.7 \times 10^{15}$; see \cite{DK}.
Both $1093$ and $3511$ are G-irregular primes.
However, $1093$ is B-regular, and $3511$ is B-irregular.

As in the classical case, the G-irregularity of primes can
be linked to the divisibility of some class numbers of cyclotomic fields.
Let $S$ be the set of infinite places of $\Q(\zeta_p)$ and $T$ the set of places above the prime 2.
Denote by $h_{p,2}$ the \textit{$(S,T)$-refined class number} of $\Q(\zeta_p)$.
Similarly, let $h_{p,2}^{+}$ be the refined class number of $\Q(\zeta_p+\zeta_p^{-1})$ with respect to its infinite places and places above the prime 2
(for the definition of the refined class number of global fields,
we refer to Gross \cite[Section 1]{Gross} or Hu and Kim \cite[Section 2]{HK}).
Define
$$
h_{p,2}^{-} = h_{p,2} / h_{p,2}^{+}.
$$
It turns out that $h_{p,2}^{-}$ is an integer
(see \cite[Proof of Proposition 3.4]{HK}).

\begin{theorem}
\label{thm:class}
 Let $p$ be an odd prime.
 Then, if $p$ is G-irregular, we have $p\mid h_{p,2}^{-}$.
 If furthermore  $p$ is not a Wieferich prime, the converse is also true.
\end{theorem}

\subsubsection{Global distribution of G-irregular primes}

Let $g$ be a non-zero integer. For an odd prime $p\nmid g$,  let ${\rm ord}_p(g)$ be the multiplicative
order of $g$ modulo $p$, that is, the smallest positive integer
$k$ such that $g^{k}\equiv 1~({\rm mod~}p)$.

\begin{theorem}
\label{thm:GB}
An odd prime $p$ is G-regular if and only
if it is B-regular and satisfies $\ord_p(4)=(p-1)/2$.
\end{theorem}

Note that $\ord_p(4)\mid (p-1)/2.$ Using quadratic reciprocity it is not difficult to
show (see Proposition~\ref{prop:splitsing}) that if $p\equiv 1~({\rm mod~}8)$,
then $\ord_p(4)\ne (p-1)/2$.
 Thus Theorem~\ref{thm:GB} has the following corollary.

\begin{corollary}
\label{cor:allepriem}
Primes $p$ satisfying $p\equiv 1~({\rm mod~}8)$
are G-irregular.
\end{corollary}

Although the B-irregular  primes are very mysterious, the set
of primes
$p$ such that $\ord_p(4)=(p-1)/2$ is far less so.
Its distributional properties are analyzed in detail in
Proposition \ref{prop:main}. The special case $a=d=1$ in
combination with Theorem \ref{thm:GB}, yields
the following estimate.
\begin{theorem}
\label{totalEirregular}
Let $\cP_G$ be the set of G-irregular primes.
Let $\epsilon>0$ be arbitrary and fixed. Then we have, for every $x$ sufficiently large,
$$
 \cP_G(x)  > \left( 1-\frac{3}{2}A-\epsilon\right) \frac{x}{\log x},$$
with
$A$ the Artin constant
\begin{equation}
\label{Artinconstantdef}
A= \prod_{\textrm{prime $p$}}\left( 1-\frac{1}{p(p-1)} \right)  = 0.3739558136192022880547280543464\ldots .
\end{equation}
\end{theorem}
\noindent Note that $1-3A/2=0.4390662795\ldots.$

Using Siegel's heuristic,
one arrives at the following conjecture.

\begin{conjecture}
\label{con:global}
Asymptotically we have
$$
\cP_G(x)\sim \left( 1-\frac{3A}{2\sqrt{e}}\right) \pi(x)~(
 \approx 0.6597765\cdot\pi(x)).
$$
\end{conjecture}

 Some numerical evidence for Conjecture \ref{con:global} is given in Section \ref{sec:data}.
The heuristic behind this conjecture is straightforward.
Under the Generalized Riemann Hypothesis (GRH) it can be shown that the set
of primes
$p$ such that
$\ord_p(4)=(p-1)/2$ has density $3A/2$ (Proposition~\ref{prop:main} with $a=d=1$). By
Siegel's heuristic one expects a fraction ${3A}/{(2\sqrt{e})}$ of these to be B-regular.
The conjecture follows on invoking Theorem~\ref{thm:GB}.

\subsubsection{G-irregular primes in prescribed arithmetic progressions}

Using Proposition \ref{prop:main} we can give a
non-trivial lower bound for the number of
G-irregular primes in a prescribed arithmetic
progression. Recall that if $S\subseteq T$
are sets of natural numbers, then the relative density of
$S$ in $T$ is defined as
$${\lim}_{x\rightarrow \infty}\frac{S(x)}{T(x)},$$
if this limit exists.
We use the notations gcd and lcm for
greatest common divisor, respectively least common multiple, but often will
write $(a,b)$,  rather than $\gcd(a,b)$.
We also use the ``big O" notation $O$, and  we write $O_\rho$ to emphasize the dependence of the implied
constant on some parameter (or a list of parameters) $\rho$.

\begin{proposition}
\label{prop:main}
Given two coprime positive integers $a$ and $d,$ we put
\begin{equation}
\label{cqda}
\cQ(d,a)=\{p>2:~p\equiv a~({\rm mod~}d),~\ord_p(4)=(p-1)/2\}.
\end{equation}
Let $\epsilon$ be arbitrary and fixed.
Then,  for every $x$ sufficiently large we have
\begin{equation}
\label{eq:underGRH2}
\cQ(d,a)(x)<
\frac{(\delta(d,a)+\epsilon)}{\varphi(d)}\frac{x}{\log x}
\end{equation}
with
$$
\delta(d,a)=c(d,a)R(d,a)A,
$$
where
\begin{equation*}
R(d,a)=2\prod_{p\mid (a-1,d)}\left( 1-\frac{1}{p}\right)
\prod_{p\mid d}\left( 1+\frac{1}{p^2-p-1}\right) ,
\end{equation*}
and
$$
c(d,a)=
\begin{cases}
3/4  & \text{if~}4\nmid d;\\
1/2  & \text{if~}4\mid d,8\nmid d,~a\equiv 1~({\rm mod~}4);\\
1  & \text{if~}4\mid d,8\nmid d,~a\equiv 3~({\rm mod~}4);\\
1  & \text{if~}8\mid d,~a\not\equiv 1~({\rm mod~}8);\\
0  & \text{if~}8\mid d,~a\equiv 1~({\rm mod~}8),
\end{cases}
$$
is the relative density of the primes
$p\not\equiv 1~({\rm mod~}8)$ in the
set of primes $p\equiv a~({\rm mod~}d).$

Under  GRH, we have
\begin{equation}
\label{eq:underGRH}
\cQ(d,a)(x)=
\frac{\delta(d,a)}{\varphi(d)}\frac{x}{\log x}
+
O_d\left(\frac{x\log\log x}{\log^2x}\right).
\end{equation}
\end{proposition}

We discuss the connection of this result and
Artin's primitive root conjecture in Section \ref{Artinmethods}.
A numerical demonstration of the
estimate \eqref{eq:underGRH} is given in Section~\ref{sec:data} for
some choices of $a$ and $d$.
 By Proposition~\ref{prop:splitsing}, in case $8 | d$ and $a\equiv 1~({\rm mod~}8)$,
we in fact have $\cQ(d,a)=\emptyset$ and so $\cQ(d,a)(x)=0$.

Combination of Theorem~\ref{thm:GB} and
Proposition~\ref{prop:main} yields directly the following result.

\begin{theorem}
\label{thm:mainArtin}
Given two coprime positive integers $a$ and $d$,  we put
$$
\cP_G(d,a)=\{p:\, p\equiv a~({\rm mod~}d) \textrm{ and  $p$ is G-irregular}\}.
$$
Let $\epsilon$ be arbitrary and fixed.
For every $x$ sufficiently large, we have
\begin{equation}
\label{dainequality}
\cP_G(d,a)(x)>
\frac{(1-\delta(d,a)-\epsilon)}{\varphi(d)}\frac{x}{\log x},
\end{equation}
where $\delta(d,a)$ is defined in Proposition~\ref{prop:main}.

Under GRH we have
\begin{equation}
\cP_G(d,a)(x)\ge
\frac{(1-\delta(d,a))}{\varphi(d)}\frac{x}{\log x}
+
O_d\left( \frac{x \log\log x}{\log^{2} x} \right) .
\end{equation}
\end{theorem}

 Note that
the inequality \eqref{dainequality} (with $a=d=1$) yields Theorem \ref{totalEirregular} as a
special case.

An easy analysis
(see \eqref{eq:delta} in Section \ref{size}) shows that $1-\delta(d,a)>0,$ and so
we obtain the following corollary, which can be compared with Theorem~\ref{thm:Met}.

\begin{corollary}
\label{cor:cor}
 Each primitive residue class contains a subset of G-irregular primes having positive density.
\end{corollary}

Moreover, by Corollary~\ref{cor:allepriem} in case  $a\equiv 1~({\rm mod~}8)$ and $8|d$
we have $1-\delta(d,a)=1$ and in fact
$\cP_G(d,a)(x)=\pi(x;d,a)$,
 where
 $$
 \pi(x;d,a) = \#\{p\le x:p\equiv a~({\rm mod~}d)\}.
 $$
In the remaining cases we have $\delta(d,a) > 0$,
and so $1-\delta(d,a) < 1$.
However, $1-\delta(d,a)$ can be arbitrarily close to 1 (see Proposition~\ref{inf-sup}),
and the same holds
for the relative density of $\cP_G(d,a)$ by Theorem~\ref{thm:mainArtin}.

Corollary  \ref{cor:cor} taken by itself is not a deep result and can
be easily proved directly, see Moree and Sha \cite[Proposition 1.6]{MS}.

The reasoning that leads us
to Conjecture \ref{con:global} in
addition with the assumption that
B-irregular primes are equidistributed over residue classes with a fixed modulus,
suggests that the following conjecture might be true.

\begin{conjecture}
\label{con:local}
Given two coprime positive integers $a$ and $d$, asymptotically we have
 $$\cP_G(d,a)(x)\sim \left( 1-\frac{\delta(d,a)}{\sqrt{e}}\right) \pi(x;d,a),$$ where $\delta(d,a)$ is defined
 in Proposition \ref{prop:main}.
 \end{conjecture}

  Numerical evidence for Conjecture \ref{con:local} is presented in Section \ref{sec:data}.
Note that this conjecture implies Conjecture \ref{con:global} (choosing $a=d=1$).
On observing that $\delta(a,d)=0$ if and only if
$8\mid d$ and $a\equiv 1~({\rm mod~}8)$,
it also implies the following conjecture.

\begin{conjecture}
\label{con:local2}
Consider the subset of G-regular primes in the primitive residue
class $a~({\rm mod~}d)$.
It has a positive density, provided
we are not in the case $8\mid d$ and
$a\equiv 1~({\rm mod~}8)$.
\end{conjecture}

\section{Preliminaries}

In this section, we gather some results which are used later on.

\subsection{Elementary results}

For a primitive Dirichlet character $\chi$ with an odd conductor $f,$
the generalized Euler numbers $E_{n,\chi}$ are defined by (see \cite[Section 5.1]{KH1})
\begin{equation*}
2\sum_{a=1}^{f}\frac{(-1)^a\chi(a)e^{at}}{e^{ft}+1}=\sum_{n=0}^{\infty}E_{n,\chi}\frac{t^n}{n!}.
\end{equation*}

For any odd prime $p$, let $\omega_p$ be the Teichm\"uller character of $\Z/p\Z.$ Any multiplicative character of $\Z/p\Z$ is of the form $\omega_p^k$ for some $1\le k \le p-1$.
In particular, the odd characters are $\omega_p^{k}$ with $k=1,3,\ldots,p-2$.

The following lemma, formulated and proved in the
notation of \cite{KH1}, is an analogue of a well-known result for the generalized Bernoulli numbers; see \cite[Corollary 5.15]{Wa}.
\begin{lemma}
\label{p4}
Suppose that $p$ is an odd prime and $k,n$
are non-negative integers. Then $E_{k,\omega_p^{n-k}}\equiv E_{n}(0) ~({\rm mod~}p).$
\end{lemma}
\begin{proof}
By \cite[Proposition 5.4]{KH1}, for arbitrary integers $k,n\geq 0$, we have
\begin{equation}\label{(1)}
E_{k,\omega_p^{n-k}}=\int_{\mathbb{Z}_{p}}\omega_p^{n-k}(a)a^{k}d\mu_{-1}(a).
\end{equation}
By \cite[Proposition 2.1 (1)]{KH1}, $E_{n}(0)$ also can be expressed as a $p$-adic integral,
namely
\begin{equation}\label{(2)}
E_{n}(0)=\int_{\mathbb{Z}_{p}}a^{n}d\mu_{-1}(a).
\end{equation}
Since $\omega_p(a)\equiv a ~({\rm mod~}p)$,  we have
\begin{equation}\label{(3)}
\begin{aligned}
\omega_p^{n-k}(a)\equiv a^{n-k} ~({\rm mod~}p) \qquad \textrm{and} \qquad \omega_p^{n-k}(a)a^{k}\equiv a^{n} ~({\rm mod~}p).
\end{aligned}
\end{equation}
From \eqref{(1)}, \eqref{(2)} and \eqref{(3)}, we deduce that
$$
E_{k,\omega_p^{n-k}}-E_{n}(0)=\int_{\mathbb{Z}_{p}}(\omega_p^{n-k}(a)a^{k}-a^{n})d\mu_{-1}(a)\equiv
0~({\rm mod~}p).\qedhere
$$
\end{proof}

Recall that $\cQ(d,a)$ is defined
in \eqref{cqda}. For ease of notation
we put
\begin{equation}
\label{Qdef}
\cQ=\cQ(1,1)=
\{p>2:\ord_p(4)=(p-1)/2\}.
\end{equation}
For the understanding of the distribution of the
primes in $\cQ,$ it turns out to be very useful to
consider their residues modulo $8$.

\begin{proposition}
\label{prop:splitsing}
For $j=1,3,5,7$ we put
$\cQ_j=\cQ(8,j).$
We have $$\cQ=\cQ_1\cup \cQ_3 \cup \cQ_5 \cup \cQ_7,$$
with $\cQ_1=\emptyset,$
and, for $j=3,5,$
$$\cQ_j=\{p: p \equiv j~({\rm mod~}8),~\ord_p(2)=p-1\},$$
and, furthermore,
$$\cQ_7=\{p: p \equiv 7~({\rm mod~}8),~ \ord_p(2)=(p-1)/2\}.$$
\end{proposition}

\begin{proof}
If $p\equiv 1~({\rm mod~}8)$, then
by quadratic reciprocity $2^{(p-1)/2}
\equiv 1~({\rm mod~}p)$,  and we
conclude that $\ord_p(4)\mid (p-1)/4$
and hence $\cQ_1=\emptyset$.

Note that
$$
\ord_p(4)=
\begin{cases}
\ord_p(2) & {\rm ~if~}\ord_p(2){\rm ~is~odd};\\
\ord_p(2)/2 & {\rm ~otherwise}.
\end{cases}
$$
In case $p\equiv \pm 3 ~({\rm mod~}8),$
we have $2^{(p-1)/2}
\equiv -1~({\rm mod~}p)$, and so
$\ord_p(2)$ must be even. The
assumption that $p$ is in $\cQ$ now
implies that $\ord_p(2)=2\cdot \ord_p(4)=
p-1.$
In case $p\equiv 7 ~({\rm mod~}8),$
we have $2^{(p-1)/2}
\equiv 1~({\rm mod~}p)$, and so
$\ord_p(2)$ must be odd. The
assumption that $p$ is in $\cQ$ now
implies that $\ord_p(2)=
\ord_p(4)=(p-1)/2$.
\end{proof}

\subsection{The size of $\delta(d,a)$}
\label{size}
In this section we study the
extremal behaviour of the quantity $\delta(d,a)$ defined in Proposition~\ref{prop:main}.
We put
$$
G(d)=\prod_{p \mid d}\left(1+\frac{1}{p^2-p-1}\right),\qquad    F(d) = \frac{\varphi(d)}{d}G(d).
$$
An easy calculation gives that
$$
G(d)=\frac{1}{A}\prod_{p \nmid d}\left(1-\frac{1}{p(p-1)}\right)=\frac{1}{A}\left(1+O(\frac{1}{q})\right),
$$
where $q$ is the smallest prime not dividing $d$.
Trivially, $G(d)<1/A$, and $G(d)<1/(2A)$ when $d$ is odd.

It is a classical result (see, for instance, \cite[Theorem 13.14]{Apostol}), that
$$
\liminf_{d \to \infty} \frac{\varphi(d)}{d}  \log\log d = e^{-\gamma},
$$
where $\gamma$ is the Euler-Mascheroni constant ($\gamma=0.577215664901532\ldots$).
The proof is in essence an application of
Mertens' theorem (see \cite[Theorem 13.13]{Apostol})
\begin{equation}
    \label{mertens}
    \prod_{p\le x}\left( 1-\frac{1}{p}\right) \sim \frac{e^{-\gamma}}{\log x}.
\end{equation}
An easy variation of the latter proof yields
$$
\liminf_{d \to \infty} AF(d)  \log\log d = e^{-\gamma}.
$$

Recall that
\begin{equation*}
R(d,a)=2G(d)\prod_{p \mid b}
\left(1-\frac{1}{p}\right)=2G(d)\frac{\varphi(b)}{b}, \text{ with } b=(a-1,d).
\end{equation*}
Note that $$2F(d)\le R(d,a)\le 2G(d)/(2,d)<1/A,$$
and hence $\delta(d,a)=0$ or
\begin{equation}
    \label{eq:delta}
0<AF(d)\le \delta(d,a)\le 2AG(d)/(2,d)<1.
\end{equation}

\begin{proposition}  \label{inf-sup}
We have
$$
\liminf_{d\to \infty} \min_{\substack{1\le a < d \\ (a,d)=1\\ \delta(d,a)>0}} \delta(d,a)\log\log d  = e^{-\gamma}
\qquad \text{and} \qquad
\limsup_{d\to \infty} \max_{\substack{1\le a < d \\ (a,d)=1}} \delta(d,a)  = 1.
$$
\end{proposition}
\begin{proof}
From the above remarks it follows that
the limit inferior and superior
are $\ge e^{-\gamma},$ respectively $\le 1.$
We consider two infinite families of pairs $(a,d)$
to show that these bounds are actually sharp.

Let $n\ge 3$ be
arbitrary. Put $d_n=\prod_{3\le p \le n} p$.
We have $c(4d_n,1)=1/2$ and
$$
\delta(4d_n,1)=(1+o(1))\prod_{2\le p\le n}(1-1/p), \quad (n\rightarrow \infty)
$$
by Proposition \ref{prop:main}.
Using Mertens' theorem \eqref{mertens}
and the prime number theorem, we deduce that
$$
\delta(4d_n,1)\sim \frac{e^{-\gamma}}{\log n}\sim
\frac{e^{-\gamma}}{\log \log (4d_n)},\quad (n\rightarrow \infty),
$$
and so the limit inferior actually equals
$e^{-\gamma}.$

Put
$$a_n=
\begin{cases}
2+3d_n& \text{~if~}d_n\equiv 7 ~({\rm mod}~8);\\
2+d_n & \text{~otherwise}.
\end{cases}
$$
We have $a_n\not\equiv 1 ~({\rm mod}~8),$ $1\le a_n<8d_n,$ $(a_n,8d_n)=1,$ and
$(a_n-1,8d_n)$ is a power of two. We infer
that $R(8d_n,a_n)=1/A+O(1/n)$ and $c(8d_n,a_n)=1,$
and so $\delta(8d_n,a_n)=1+O(1/n),$
showing that the limit superior equals $1$.
\end{proof}

The two constructions in the above proof
are put to the test
in Table~\ref{tab:cRA}.
The table also gives an idea of how fast
the lower bound $1-\delta(4d_n,1)$
for the relative density of the set $\cP_G(4d_n,1)$
established in Theorem~\ref{thm:mainArtin}, tends to $1$.

\begin{table}
\centering
\caption{Some values of $\delta(4d_n,1)$ and $\delta(8d_n,a_n)$}
\label{tab:cRA}
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
$n$ & $10^3$ & $10^4$ & $10^5$ & $10^6$ & $10^7$    \\ \hline
$\delta(4d_n,1)\approx $ & 0.080954  &  0.060884 & 0.048752 & 0.040638 & 0.034833   \\ \hline

$\delta(4d_n,1)e^{\gamma}\log \log (4d_n)\approx $ &
0.989659  & 0.997633  & 0.999422 &  0.999851 &  0.999960  \\ \hline

$\delta(8d_n,a_n) \approx $ & 0.999872  &  0.999990 & 0.999999 & 0.9999999 & 0.99999999  \\ \hline

\end{tabular}
\end{table}

\section{Some results related to Artin's primitive root conjecture}
\label{Artinmethods}
It is natural to wonder whether the set
$\cQ,$ see \eqref{Qdef},  is an infinite set or not. This is closely
related to Artin's primitive root conjecture
stating that if $g\ne -1$ or a square, then
infinitely often $\ord_p(g)=p-1$ (which is maximal by Fermat's little theorem).
In case $g$ is a square, the maximal order is
$(p-1)/2$ and one can wonder whether this happens
infinitely often.
If this is so for $g=4,$ then our
set $\cQ$ is infinite. We now go into a bit
more technical detail.

We say that a set of primes $\cP$ has
density $\delta(\cP)$ and satisfies a Hooley type
estimate, if
\begin{equation}
\label{hooleytype}
 \cP(x)=\delta(\cP)\frac{x}{\log x}+
O\left(\frac{x\log\log x}{\log^2x}\right),
\end{equation}
where the implied constant may depend on $\cP$.

Let $g\not \in\{-1,0,1\}$ be
an integer.
Put
$${\mathcal P}_g=\{p: \ord_p(g)=p-1\}.$$
Artin in 1927 conjectured that this set, when $g$ is not a square, is infinite and also conjectured a density for it.
To this day, this conjecture is open; see \cite{Moree} for a survey.
Hooley \cite{Hooley1} proved in 1967
that if the Riemann Hypothesis holds for the number fields
$\Q(\zeta_n,g^{1/n})$ with all square-free $n$ (this is a weaker
form of the GRH), then the
estimate \eqref{hooleytype} holds for the set $\cP_g$  with
\begin{equation*}
\delta(g):=\delta(\cP_g)=\sum_{n=1}^\infty
\frac{\mu(n)}{[\Q(\zeta_n,g^{1/n}):\Q]},
\end{equation*}
where $\mu$ is the M{\"o}bius function;
and he also showed that $\delta(g)/A$ is rational
and explicitly determined its value,
with $A$ the Artin constant (see \eqref{Artinconstantdef}).
For example, in case $g=2$ we have $\delta(2)=A$.

By the Chebotarev density theorem,  the density of primes
$p\equiv 1 ~({\rm mod~}n)$ such that $\ord_p(g)\mid (p-1)/n$
is equal to $1/[\Q(\zeta_n,g^{1/n}):\Q]$.
Note that in order to ensure that
$\ord_p(g)=p-1$,  it is enough
to show that there is no prime $q$
such that $\ord_p(g)\mid (p-1)/q$.
By inclusion and exclusion we
are then led to expect that
the set $\cP_g$ has natural
density $\delta(g)$. The problem
with establishing this rigorously is
that the Chebotarev density theorem
only allows one to take finitely many
splitting conditions into account. Let
us now consider which result we can obtain on
restricting to the primes $q\le y.$
Put
\begin{equation}
\label{classicalhooley2}
\delta_y(g)=\sum_{P(n)\le y}
\frac{\mu(n)}{[\Q(\zeta_n,g^{1/n}):\Q]},
\end{equation}
where $P(n)$ denotes the largest prime factor of $n.$
Now we may apply
the Chebotarev density theorem and
we obtain
that
\begin{equation}
\label{deltayg}
\cP_g(x)\le
(\delta_y(g)+\epsilon)\frac{x}{\log x},
\end{equation}
where $\epsilon>0$ is arbitrary and
$x, y$ are sufficiently large (where sufficiently large may depend on the
choice of $\epsilon$).

Completing the sum in
\eqref{classicalhooley2} and using that
$[\Q(\zeta_n,g^{1/n}):\Q]\gg_{g}n\varphi(n)$ (see \cite[Proposition 4.1]{Wagstaff}) and the classical estimate
$\varphi(n)^{-1}=O((\log \log n)/n)$,
we obtain that
$$
\delta_y(g)=\delta(g)+O_g\left(\sum_{n\ge y}
\frac{1}{n\varphi(n)}\right)=\delta(g)+O_g\left(\frac{\log \log y}{y} \right).
$$
On combining this with
\eqref{deltayg} we obtain the
estimate
\begin{equation}
\label{deltag}
\cP_g(x)\le
(\delta(g)+\epsilon)\frac{x}{\log x},
\end{equation}
where $\epsilon>0$ is arbitrary and
$x, y$ are sufficiently large
 (where sufficiently large may depend on the
choices of $\epsilon$ and $g$).

For any integer $g \not\in \{-1,0,1\}$ and any integer $t \ge 1$, put
$$
{\mathcal P}(g,t)=\{p: \,
p\equiv 1 ~({\rm mod~}t),~ \ord_p(g)=(p-1)/t\}.
$$
Now, if the Riemann Hypothesis holds for the number fields
$\Q(\zeta_{nt},g^{1/nt})$ with all square-free $n$,  then
Hooley's proof can be easily extended, resulting in the
estimate \eqref{hooleytype}
for the set $\cP(g,t)$
with density
\begin{equation}
\label{classicalwagstaff}
\delta(g,t)=\sum_{n=1}^\infty
\frac{\mu(n)}{[\Q(\zeta_{nt},g^{1/nt}):\Q]},
\end{equation}
and with $\delta(g,t)/A$ a rational number; see \cite{Lenstra}.
This number was first computed
explicitly by Wagstaff \cite[Theorem 2.2]{Wagstaff},
which can be done much more
compactly and elegantly these days
using the character sum method of Lenstra et al.~\cite{LMS}.

By Wagstaff's work \cite{Wagstaff} we have
$\delta(\cQ)=\delta(4,2)=3A/2.$
Alternatively it is an easy and instructive calculation
to determine $\delta(4,2)$ oneself. Since
$\sqrt{2}\in \mathbb Q(\zeta_n)$ if and only if $8 \mid n$, we see
that if $4\nmid n,$ then
$[\Q(\zeta_{2n},2^{1/2n}):\Q]=\varphi(2n)n$ and
so by \eqref{classicalwagstaff},
$$
\delta(4,2)=\sum_{n=1}^{\infty}\frac{\mu(n)}{\varphi(2n)n}=\sum_{2\nmid n}^{\infty}\frac{\mu(n)}{\varphi(n)n}
+\sum_{2\mid n}^{\infty}\frac{\mu(n)}{2\varphi(n)n}=
\frac{3}{4}\sum_{2\nmid n}^{\infty}\frac{\mu(n)}{\varphi(n)n}=\frac{3}{2}A,
$$
where we use the fact that
$$
\sum_{n=1\atop (m,n)=1}^{\infty}\mu(n)f(n)=\prod_{p\nmid m}(1-f(p))
$$
holds certainly true if the sum is absolutely convergent and $f(n)$ is a multiplicative function defined on the square free integers (cf.
Moree and Zumalac\'arregui \cite[Appendix A.1]{Zuma},
where a similar problem with $g=9$
instead of $g=4$ is considered).

The following result generalizes the above to
the case where we require the primes in
${\mathcal P}(g,t)$ to also be in some prescribed
arithmetic progression. It follows from Lenstra's work \cite{Lenstra}, who introduced Galois theory
into the subject.

\begin{theorem}
\label{lenstrarekenkundigerij}
Let $1\le a\le d$ be coprime integers.
Let $t\ge 1$ be an integer.
Put
$${\mathcal P}(g,t,d,a)=\{p:\,
p\equiv 1~({\rm mod~}t),~p\equiv a~({\rm mod~}d),~\ord_p(g)=(p-1)/t\}.$$
Let
$\sigma_a$ be the automorphism of $\mathbb Q(\zeta_d)$ determined by
$\sigma_a(\zeta_d)=\zeta_d^a$. Let $c_a(m)$ be $1$ if the restriction
of $\sigma_a$ to the field $\mathbb Q(\zeta_d)\cap \mathbb Q(\zeta_m,g^{1/m})$
is the identity and $c_a(m)=0$ otherwise. Put
\begin{equation*}
\delta(g,t,d,a)=\sum_{n=1}^{\infty}\frac{\mu(n)c_a(nt)}{[\mathbb Q(\zeta_d,\zeta_{nt},g^{1/nt}):\mathbb Q]}.
\end{equation*}
Then, assuming RH for all
number fields $\Q(\zeta_d,\zeta_{nt},g^{1/nt})$ with
$n$ square-free,
we have
\begin{equation}
\label{hooleygeneral}
{\mathcal P}(g,t,d,a)(x)=\delta(g,t,d,a)\frac{x}{\log x}+
O_{g,t,d}\left(\frac{x\log\log x}{\log^2x}\right),
\end{equation}

Unconditionally we have the weaker
statement that
\begin{equation}
\label{deltagtfa}
{\mathcal P}(g,t,d,a)(x)  \le
(\delta(g,t,d,a)+\epsilon)\frac{x}{\log x},
\end{equation}
where $\epsilon>0$ is arbitrary and
$x$ is sufficiently large (where sufficiently large may depend on the
choice of $\epsilon,g,t,d$ and $a$).
\end{theorem}

It seems that this result has
not been formulated in the literature.
It is a simple combination of two cases each of which
have been intensively studied, namely the primes
having a near-primitive root $(d=1,t>1),$ and
the primes in arithmetic progression having
a prescribed primitive root ($t=1$).

As before $\delta(g,t,d,a)/A$ is a
rational number that can be explicitly computed.
The case $g=t=2,$ $d=8$ and $a=7$ is one of the most
simple cases. This is a lucky coincidence, as in our proof of
Proposition \ref{prop:main}
we will apply Theorem \ref{lenstrarekenkundigerij}  to determine $\delta(\cQ_7)=\delta(2,2,8,7)$.

Note that
$
\cP(g,t,d,a)\subseteq \{p:\, p\equiv 1~({\rm mod~}t),~p\equiv a~({\rm mod~}d),~\ord_p(g) \mid (p-1)/t\}.
$
It is shown in \cite[Theorem 1.3]{MS} that if
the latter set
is not empty, then it contains a positive density subset of
primes that are not in ${\mathcal P}(g,t,d,a).$

\section{Proofs of the main results}

It suffices to prove Theorems~\ref{thm:class} and \ref{thm:GB} and Proposition~\ref{prop:main}.

\subsection{Proof of Theorem~\ref{thm:class}}

By \cite[Proposition 3.4]{HK}, we obtain
\begin{equation*}
h_{p,2}^{-}=(-1)^{\frac{p-1}{2}}2^{2-p}E_{0,\omega_p}E_{0,\omega_p^{3}}\cdots E_{0,\omega_p^{p-2}}.
\end{equation*}
Using Lemma \ref{p4} and \eqref{eq:EnGn}, we then infer that
\begin{align*}
h_{p,2}^{-} & \equiv (-1)^{\frac{p-1}{2}}2^{2-p}E_{1}(0)E_{3}(0)\cdots E_{p-2}(0) \\
& \equiv \frac{(-1)^{\frac{p-1}{2}}2^{2-p}}{(p-1)!!}G_2 G_4 \cdots G_{p-3} G_{p-1} ~({\rm mod~}p).
\end{align*}
So, if $p$ is G-irregular, then $p \mid h_{p,2}^{-}$.
Conversely, if $p \mid h_{p,2}^{-}$ and  $p$ is not a Wieferich prime,
then by \eqref{eq:BnGn} we first have $p \nmid G_{p-1}$,
and thus $p$ is G-irregular.
\qed

\subsection{Proof of Theorem~\ref{thm:GB}}

We first recall a fact about Bernoulli numbers that
any odd prime $p$ does not divide the denominators of the Bernoulli numbers $B_2, B_4, \ldots, B_{p-3}$
(this follows from the von Staudt-Clausen theorem).
Now, given an odd prime $p$, if it is G-regular, then
there is no $1\le k \le (p-3)/2$ such that
$p$ divides the integer $G_{2k}$, that is, $2(1-2^{2k})B_{2k}$ by \eqref{eq:BnGn};
and so $p$ is B-regular and $\ord_p(4)=(p-1)/2$.

Conversely, if $p$ is B-regular and $\ord_p(4)=(p-1)/2$,
then $p$ does not divide the denominators of the Bernoulli numbers $B_2, B_4, \ldots, B_{p-3}$
and $p\nmid 2^{2k}-1$ for
 $1\le k\le (p-3)/2.$
Consequently $p$ does not divide any integer $G_{2k}=2(1-2^{2k})B_{2k}$
with $1\le k\le (p-3)/2$,
which implies that $p$ is G-regular. \qed

\subsection{Proof of Proposition~\ref{prop:main}}
The proof relies on Theorem \ref{lenstrarekenkundigerij}.
We only establish the assertion
under GRH, as the proof of
the unconditional result is very similar. Namely,
it uses the unconditional estimate \eqref{deltagtfa} instead of
\eqref{hooleygeneral}.

It is enough to prove the result in case $8\mid d.$
In fact, in case $8\nmid d$ we lift the congruence class $a~({\rm mod~}d)$
to congruence classes
with modulus lcm$(8,d)$. The ones among those that
are $\not\equiv 1~({\rm mod~}8)$ have
relative density $AR({\rm lcm}(8,d),a)=AR(d,a)$ (as $R(d,a)$ only depends
on the odd prime factors of $d$). The one that is
$\equiv 1~({\rm mod~}8)$ (if it exists at all) has relative density zero.
It follows that the relative density of the unlifted congruence
equals $c(d,a)R(d,a)A$ with $c(d,a)$ the relative density  of the primes
$p\not\equiv 1~({\rm mod~}8)$ in the congruence class
 $a~({\rm mod~}d).$ The easy determination of $c(d,a)$ is left
 to the interested reader.

From now on we assume that $8\mid d.$
We can write $a\equiv j~({\rm mod~}8)$ for some
$j\in \{1,3,5,7\}$ and
distinguish three cases.

{\it Case I: $j=1$.}  By Proposition \ref{prop:splitsing} the set $\cQ(d,a)$ is empty and the result
holds trivially true.

{\it Case II: $j\in \{3,5\}$.} By Proposition \ref{prop:splitsing},
$$\cQ(d,a)=\{p:~p\equiv a~({\rm mod~}d),~\ord_p(2)=p-1\}.$$
By Theorem \ref{lenstrarekenkundigerij}, under GRH, this
set has density $\delta(2,1,d,a).$ For arbitrary
$g,d,a$ the third author determined the rational number
$\delta(g,1,d,a)/A,$ see \cite[Theorem 1]{Mor1} or
\cite[Theorem 1.2]{Mor2}. On applying his result, the proof of this subcase is
then completed.

{\it Case III: $j=7$.} By Proposition \ref{prop:splitsing},
$$\cQ(d,a)=\{p:~p\equiv a~({\rm mod~}d),~\ord_p(2)=(p-1)/2\}.$$
For simplicity we write $\delta=\delta(\cQ(d,a)).$
By Theorem \ref{lenstrarekenkundigerij} we have
\begin{equation}
    \label{startertje}
\delta=\delta(2,2,d,a)=
\sum_{n=1}^{\infty}
\frac{\mu(n)c_a(2n)}{[\mathbb Q(\zeta_d,\zeta_{2n},2^{1/2n})
:\mathbb Q]}.
\end{equation}
In case $n$ is even, then trivially
$\mathbb Q(\sqrt{-1})\subseteq \mathbb Q(\zeta_d)\cap
\mathbb Q(\zeta_{2n},2^{1/2n}).$
As $\sigma_a$ acts by conjugation
on $\mathbb Q(\sqrt{-1}),$ cf. \cite[Lemma 2.2]{Mor2}, and
not as the identity, it follows that $c_a(2n)=0.$

Next assume that $n$ is odd and square-free.
Then by \cite[Lemma 2.4]{Mor2} we infer that
$$\mathbb Q(\zeta_d)\cap \mathbb Q(\zeta_{2n},2^{1/2n})
=\mathbb Q(\zeta_{(d,n)},\sqrt{2}).$$
Since
$$
\sigma_a \big |_{\mathbb Q(\sqrt{2})}=\text{id.} \qquad \text{and} \qquad
\sigma_a \big |_{\mathbb Q(\zeta_{(d,2n)})}
\begin{cases}
= \text{id.} & \text{if~}a\equiv 1~({\rm mod~}(d,2n));\\
\ne \text{id.} & \text{otherwise},
\end{cases}
$$
we conclude that
$$
c_a(2n) =
\begin{cases}
 1 & \text{if~}a\equiv 1~({\rm mod~}(d,2n));\\
0 & \text{otherwise},
\end{cases}
$$
with `id.'\,a shorthand for identity.
Note that the assumptions on $a,d$ and $n$ imply that
$a\equiv 1~({\rm mod~}(d,2n))$ iff
$a\equiv 1~({\rm mod~}2(d,n))$ iff
$a\equiv 1~({\rm mod~}(d,n)).$
It follows that \eqref{startertje} simplifies to
$$
\delta=
\sum_{\substack{2\nmid n\\ a\equiv 1~({\rm mod~}(d,n))}}
\frac{\mu(n)}{[\mathbb Q(\zeta_d,\zeta_{2n},2^{1/2n})
:\mathbb Q]}.
$$
When $n$ is odd and square-free, using \cite[Lemma 2.3]{Mor2} we obtain
$$
[\mathbb Q(\zeta_d,\zeta_{2n},2^{1/2n})
:\mathbb Q]=[\mathbb Q(\zeta_{\text{lcm}(d,2n)},2^{1/2n})
:\mathbb Q]=
n\varphi(\text{lcm}(d,2n))=n\varphi(\text{lcm}(d,n)).$$
We thus get
$$
\varphi(d)\delta=\sum_{\substack{2\nmid n\\ a\equiv 1~({\rm mod~}(d,n))}}
\frac{\mu(n)\varphi(d)}{n\varphi(\text{lcm}(d,n))}.
$$
Put
$$w(n)=\frac{n\varphi(\text{lcm}(d,n))}{\varphi(d)}.$$
In this notation
we obtain
$$
\delta=\frac{1}{\varphi(d)}
\sum_{\substack{2\nmid n\\ a\equiv 1~({\rm mod~}(d,n))}}
\frac{\mu(n)}{w(n)},
$$
where the argument in the sum is multiplicative
in $n.$
Using \cite[Lemma 3.1]{Mor2} and the notation used there and
in \cite[Theorem 1.2]{Mor2},
we find

\begin{equation*}
\begin{split}
\varphi(d)\delta & = S(1)-S_2(1)=2S(1)=2A(a,d,1)\\
&=2A\prod_{p|(a-1,d)}(1-\frac{1}{p})\prod_{p|d}
\left(1+\frac{1}{p^2-p-1}\right)=\delta(d,a),
\end{split}
\end{equation*}
as was to be proved. \qed

\section{Outlook}
A small improvement of
the upper bound
\eqref{eq:underGRH2}
(and consequently the lower
bound \eqref{dainequality}) would be possible if
instead of the estimate \eqref{deltagtfa}
a Vinogradov
type estimate for $\cP(g,t,d,a)(x)$ could be established, say
\begin{equation}
\label{vinogradovtypeadvanced}
  \cP(g,t,d,a)(x)  \le \delta(g,t,d,a)\frac{x}{\log x} + O_{g,t,d}\left(\frac{x(\log\log x)^2}{\log^{5/4} x} \right).
\end{equation}
Vinogradov \cite{Vino} established the above result in
case $a=d=t=1$.
Establishing \eqref{vinogradovtypeadvanced} seems technically quite involved. Recent work
by Pierce et al.~\cite{effectChebo}
offers perhaps some hope that one can even improve
on the error term in \eqref{vinogradovtypeadvanced}.

\section{Some numerical experiments}  \label{sec:data}

In this section, using the Bernoulli numbers modulo $p$ function developed by David Harvey in  Sage~\cite{Sage}
(see \cite{BH,HHO,Harvey10} for more details and improvements) and the euler{\_}number function in Sage,
 we provide numerical evidence for the truth of Conjectures~\ref{conj:Siegel2}, \ref{conj:E-irre2}, \ref{con:global} and \ref{con:local}
and also for \eqref{eq:underGRH} in Proposition~\ref{prop:main}.

The Bernoulli numbers modulo $p$ function returns the values of $B_0, B_2, \ldots, B_{p-3}$ modulo $p$,
and so by checking whether there is a zero value we can determine whether $p$ is B-irregular.
For checking the E-irregularity, we use the euler{\_}number function in Sage to compute and store Euler numbers
and then use the definition of E-irregularity.
It would be a separate project to test large E-irregular primes,
cf.\,\cite{BH,HHO,Harvey10}.

In the tables, we only record the first six digits of the decimal parts.

In Tables~\ref{tab:B-irre} and
~\ref{tab:E-irre} the ratio $\cP_B(d,a)(x)/\pi(x;d,a),$
respectively $\cP_E(d,a)(x)/\pi(x;d,a)$ is recorded for
$x=10^5$ in the column `experimental' for
various choices of $d$ and $a$, and in the column `theoretical'
the limit value
predicted by Conjecture~\ref{conj:Siegel2} is given.

\begin{table}
\centering
\caption{The ratio $\cP_B(d,a)(x)/\pi(x;d,a)$ for $x=10^5$}
\label{tab:B-irre}
\begin{tabular}{|c|c|c|c|}
\hline
$d$ & $a$    & experimental & theoretical  \\ \hline \hline

3 & 2 & 0.394424  &  \\ \cline{1-2}

4 & 1 & 0.388877  &  \\ \cline{1-2}

5 & 4 & 0.397071  &   \\ \cline{1-2}

7 & 4 &  0.391005 & 0.393469  \\ \cline{1-2}

9 & 8 & 0.387742  &  \\ \cline{1-2}

12 & 5 & 0.390203  &  \\ \cline{1-2}

15 & 13 & 0.389858  &  \\ \cline{1-2}

20 & 13 &  0.385191 &  \\ \hline

\end{tabular}
\end{table}

\begin{table}
\centering
\caption{The ratio $\cP_E(d,a)(x)/\pi(x;d,a)$ for $x=10^5$}
\label{tab:E-irre}
\begin{tabular}{|c|c|c|c|}
\hline
$d$ & $a$    & experimental & theoretical  \\ \hline \hline

3 & 2 &  0.395672 &  \\ \cline{1-2}

4 & 1 & 0.388040  &  \\ \cline{1-2}

5 & 4 & 0.397071  &   \\ \cline{1-2}

7 & 4 &  0.393504 & 0.393469  \\ \cline{1-2}

9 & 8 & 0.391494  &  \\ \cline{1-2}

12 & 5 & 0.388127  &  \\ \cline{1-2}

15 & 13 & 0.399002  &  \\ \cline{1-2}

20 & 13 & 0.385191 &  \\ \hline

\end{tabular}
\end{table}

Table~\ref{tab:G-irre1} gives the ratio
$\cP_G(x)/\pi(x)$ for various values of $x,$ and the value in the column `theoretical' is the limit value
$1-3A/(2\sqrt{e})$ predicted by Conjecture~\ref{con:global}.

\begin{table}
\centering
\caption{The ratio $\cP_G(x)/\pi(x)$}
\label{tab:G-irre1}
\begin{tabular}{|c|c|c|}
\hline
$x$ & experimental & theoretical  \\ \hline \hline

$10^5$ & 0.661592  & \\ \cline{1-2}

$10^6$ & 0.659558  & \\ \cline{1-2}

$2\cdot 10^6$  & 0.660860  & 0.659776 \\ \cline{1-2}

$3\cdot 10^6$  & 0.661413  & \\ \cline{1-2}

$4\cdot 10^6$  & 0.660683  & \\ \cline{1-2}

$5\cdot 10^6$ &  0.660864  & \\ \hline

\end{tabular}
\end{table}

Table~\ref{tab:G-irre2} gives the ratio $\cP_G(d,a)(x)/\pi(x;d,a)$ for
$x=5 \cdot 10^6$ in the column `experimental' for
various choices of $d$ and $a$, and the corresponding
limit values $1-c(d,a)R(d,a)A/\sqrt{e}$
predicted by Conjecture~\ref{con:local}
are in the column `theoretical'.

\begin{table}
\centering
\caption{The ratio $\cP_G(d,a)(x)/\pi(x;d,a)$ for $x=5 \cdot 10^6$}
\label{tab:G-irre2}
\begin{tabular}{|c|c|c|c|}
\hline
$d$ & $a$ & experimental & theoretical  \\ \hline \hline

3 & 1 & 0.728296  & 0.727821 \\ \hline

5 & 2 & 0.643010  & 0.641870 \\ \hline

4 & 1 & 0.771512  & 0.773184 \\ \hline

20 & 9 &  0.757311 & 0.761246 \\ \hline

12 & 11 & 0.460584  & 0.455642 \\ \hline

20 & 19 & 0.528567  & 0.522493 \\ \hline

8 & 7 & 0.550086  & 0.546368 \\ \hline

24 & 13 & 0.634191  & 0.637094 \\ \hline

\end{tabular}
\end{table}

Finally, Table~\ref{tab:distrioverAP} gives the ratio
${\mathcal Q}(d,a)(x) / \pi(x;d,a)$
for  $x= 5 \cdot 10^6$ in the column `experimental' for
various choices of $d$ and $a$.
In the column `theoretical', there is
the corresponding relative
density $\delta(d,a)$
predicted in \eqref{eq:underGRH} and known to be true under GRH.

\begin{table}
\centering
\caption{The ratio $\cQ(d,a)(x)/\pi(x;d,a)$ for $x=5 \cdot 10^6$}
\label{tab:distrioverAP}
\begin{tabular}{|c|c|c|c|}
\hline
$d$ & $a$ & experimental & theoretical  \\ \hline \hline

3 & 1 & 0.449049  & 0.448746 \\ \hline

5 & 2 & 0.589614  &  0.590456  \\ \hline

4 & 1 & 0.374664  & 0.373955 \\ \hline

20 & 9 & 0.395498  & 0.393637 \\ \hline

12 & 11 & 0.898284  & 0.897493 \\ \hline

20 & 19 & 0.789316  & 0.787275 \\ \hline

8 & 7 & 0.747300  & 0.747911 \\ \hline

24 & 13 & 0.598815  & 0.598329 \\ \hline
\end{tabular}
\end{table}

In view of the definition of
the constant $c(d,a)$ in Proposition~\ref{prop:main},
there are four cases excluding the case $8 | d$ and $a \equiv 1 ~({\rm mod}~8)$ (which gives $c(d,a)=0$).
For each of these four cases there are two instances in Tables~\ref{tab:G-irre2} and \ref{tab:distrioverAP}.

\section*{Acknowledgement}
The authors would like to thank the referee for careful reading and valuable comments.
This work was supported by the National Natural Science Foundation  of China, Grant
No.\,11501212.
The research of Min-Soo Kim and Min
Sha was also supported by the Kyungnam University Foundation Grant, 2017,
respectively a Macquarie University Research Fellowship.
The authors thank Bernd Kellner for pointing out a link with the Genocchi numbers
and suggesting the references \cite{Ern2, HP, Holden},
and Peter Stevenhagen for very helpful feedback.
They also thank Alexandru Ciolan for proofreading earlier versions.