# SRGz: building an optical cross-match model for the X-ray SRG/eROSITA
sources using the Lockman Hole data

M. I. Belvedersky  1,4<EMAIL_ADDRESS>A. V. Meshcheryakov  1,2  M.
R. Gilfanov  1,3  P. S. Medvedev 1Space Research Institute (IKI), Russian
Academy of Sciences, Profsoyuznaya ul. 84/32, Moscow, 117997 Russia 2Lomonosov
Moscow State University (MSU), Moscow, Russia 3Max-Planck-Institut für
Astrophysik (MPA), Karl-Schwarzschild-Str. 1, D-85741 Garching, Germany
4National Research University Higher School of Economics (HSE), Moscow, Russia
1

###### Abstract

We present a probabilistic model built for the optical cross-match between the
SRG/eROSITA X-ray sources and photometric data from the DESI Legacy Imaging
Surveys. The model relies both on positional and photometric information on
optical objects nearby X-ray sources and allows performing selection with
precision and recall $\approx 94$% (for $F_{\rm X,0.5-2}>10^{-14}$ erg/s/cm2).
With this model, we calibrated positional error of the SRG/eROSITA sources
detected in the Lockman Hole: $\sigma_{\rm corr}=0.87\sqrt{\sigma_{\rm
det}^{2.53}+1.12^{2}}$.

The model will become a part of the SRGz system for data analysis of the X-ray
data obtained from the all-sky SRG/eROSITA survey.

###### keywords:

SRG, eROSITA, sky surveys, optical cross-match, SDSS, DESI Legacy Surveys

2021001[0]

28.12.2021

##  1 Introduction

High-energy astrophysics space observatory Spektr-RG (SRG, Sunyaev et al.
2021) was launched on July 13, 2019 and is operating in a halo orbit around
the L2 libration point of the Earth-Sun system. The main goal of the
observatory is to perform a four-year all-sky survey in the energy band 0.2-30
keV. There are two telescopes onboard SRG: SRG/eROSITA (Predehl et al., 2021)
and Mikhail Pavlinsky ART-XC (Pavlinsky et al., 2021).

We can obtain just a few parameters for most of the SRG/eROSITA sources: a
position on the sky (within the positional error) and a flux. We need more
information to explore physical properties of the sources. First, we need to
define their physical class: a star, a QSO, etc. In most cases, we obtain such
information from the optical spectrum of the X-ray sources counterparts. To
perform optical spectroscopy, one needs to match an X-ray source with its
optical counterpart. In other words, to perform the optical cross-match. X-ray
sources are usually hard to cross-match because of their significant
positional error: often, we see numerous optical candidates within the error
radius. This problem gets more complicated within the galaxy plane, where we
see numerous optical objects. For these reasons, we need a cross-match model
that allows measuring the probability of correct identification. For every
optical object in the vicinity of an X-ray source, we need to calculate the
probability to be a counterpart $p_{\rm match}$. The model also should allow
calculating the probability that an X-ray source does not have an optical
counterpart at all within some photometric survey ($p_{\varnothing}$).

The model should respect the following requirements:

  1. 1.

A counterpart prediction must be based on both positional and photometric
information on optical objects nearby the X-ray sources

  2. 2.

An optical counterpart might be absent in a photometric catalogue. The model
must warn us about it with the high value of the according probability
($p_{\varnothing}$).

  3. 3.

We are interested in two different selection regimes: with a high precision
(80% and higher) or with a high recall (90% and higher). The former regime is
preferable when we search for unique and rare sources; the latter suits the
tasks similar to QSO luminosity function measurement (when one needs to reduce
the selection effects). Therefore, the model must allow performing a selection
of the X-ray sources in both regimes by varying the $p_{\varnothing}$
threshold.

The most widespread approach to the correlation between astronomical
catalogues is based on the likelihood ratio method and was first introduced in
Sutherland & Saunders 1992. The approach was applied and developed in Oyabu et
al. 2005; Naylor et al. 2013 etc. The likelihood ratio method was successfully
applied to find counterparts of the X-ray sources in such surveys as XMM-
COSMOS (Brusa et al., 2007), Chandra-COSMOS (Civano et al., 2012; Marchesi et
al., 2019), STRIPE-82X (Lamassa et al., 2016; Ananna et al., 2019). As a
generalisation of the likelihood ratio method, one can consider methods based
on Bayesian statistics (Budavári & Loredo, 2015; Pineau et al., 2017; Salvato
et al., 2018).

We present a cross-match model built for the correlation of point-like X-ray
sources discovered by SRG/eROSITA in the Lockman Hole area. The Lockman Hole
(LH, Lockman et al. 1986) is a sky field that fits well for the observations
of extragalactic sources. The absorption of the X-ray radiation is relatively
low (the typical column density of neutral hydrogen in this region is about
$N_{H}\approx 4.5\times 10^{19}$ cm-2). With the SRG/eROSITA X-ray data and
optical observations from the DESI Legacy Imaging Surveys obtained in this
unique area, we have tested a cross-match approach that will be applied for
the all-sky SRG/eROSITA survey.

The optical cross-match model for point-like X-ray sources presented in this
paper is part of a more complex system called SRGz. The SRGz system has been
developed by IKI RAS to analyse the SRG/eROSITA survey. This paper is the
first in a series of publications presenting models and algorithms built for
the SRGz. The main goal of SRGz is to perform a multi-survey cross-correlation
and determine the physical properties of the SRG/eROSITA sources.

One of the main model characteristics is the relationship between the X-ray
sources positional error ($\sigma$) and its detection
likelihood111$\pazocal{L}=-\ln(p)$, where $p$ is a null hypothesis probability
for a source to be produced by the noise component on an X-ray image
($\pazocal{L}$). We will measure the $\sigma(\pazocal{L})$ relationship as a
byproduct of the model development using the optical data obtained in an X-ray
sources’ localisation area.

The standard algorithm for the point-like X-ray sources detection and
characterisation allows calculating both position and positional error
($\sigma_{\rm det}$) for every X-ray source. The model we have built can be
used for an independent verification of this positional error.

The paper has the following structure. Optical and X-ray data are described in
§2. This Section also contains the description of the test sample designed to
verify our model. In §3 we present our cross-match model built for the
correlation of the SRG/eROSITA Lockman Hole X-ray sources. The results are
listed in Section 4. The last Section contains summarised findings and
conclusions.

##  2 Data

###  2.1 X-ray data

The Lockman Hole observations took place during the performance verification
phase of SRG/eROSITA in October 2019. The observations were done in a raster
scanning regime. This regime has notable advantages in comparison to the
mosaic one, which is the most common scanning regime for the majority of
modern X-ray observatories (when survey fields are covered by pointing
observations). The raster scanning regime allows obtaining wide field X-ray
images with almost unaltered sensitivity (within the image) and PSF.

The raster scanning scheme for the Lockman Hole consists of parallel scans in
alternate directions (with the orientation roughly corresponding to the
ecliptic coordinate system) with the shift equal 11.7 arcminutes. Scan speed
was 9.1 arcseconds (which is an order of magnitude slower than in the whole-
sky scanning regime). The field of the view of eROSITA is 1 degree which means
that every source was observed continuously during $\sim 6.6$ minutes. The
footprint of the LH survey is $\approx 18.5$ square degrees ($5^{\circ}\times
3.7^{\circ}$) with the centre coordinates $\alpha=10^{\rm h}35^{\rm m}$ and
$\delta=+57^{\circ}38^{\prime}$. Total duration of the survey is $180$ ks,
mean exposure time is about $8$ ks per point. These parameters allow achieving
sensitivity $\approx 3\times 10^{-15}$ erg/s/cm2 in $0.5-2$ keV energy range.

The primary data processing has been performed using the software developed in
IKI RAS which includes components of the eROSITA Science Analysis Software
System (eSASS, developed in Max Planck Institute for Extraterrestrial Physics,
Germany). The source detection was performed using an approximation of a
distribution in counts based on the eROSITA PSF (the ermldet program, eSASS).
The total number of detected sources is $8309$ (with detection likelihood
$\pazocal{L}>6$). The average surface density in the Lockman Hole is $\sim
370$ sources per square degree which is comparable with the density in other
X-ray surveys with close characteristics such as XBootes (9.3 square degrees,
Murray et al. 2005) and XMM-XXL-North (18.5 square degrees, Menzel et al.
2016).

About 20% of the survey footprint were observed previously with other X-ray
telescopes such as ROSAT, Chandra and XMM-Newton. In this work we use
observations obtained by Chandra and XMM-Newton presented in CSC 2.0 (Evans et
al., 2010) and 4XMM DR10 (Webb et al., 2020) catalogues accordingly. These
data allow us to examine the quality of our cross-match algorithm (see §2.3
bellow).

###  2.2 Optical data

To correlate the X-ray SRG/eROSITA sources, we will use optical data from
public photometric surveys — the DESI Legacy Imaging Surveys DR8 (DESI LIS,
Dey et al. 2019) and SDSS DR14 (Abolfathi et al., 2018).

Figure 1: An example of an optical field around the SRG/eROSITA source from
the test sample with counterparts. Semitransparent circles are the 95%
localisation areas of the X-ray sources SRG/eROSITA (a grey region in the
centre), XMM-Newton (an area around the ”+” symbol), and Chandra (an area
around the cross). The XMM-Newton and Chandra data indicate an optical
counterpart (see details in the text).

###  2.3 Test catalogue with optical counterparts for the Lockman Hole

To examine the quality of our model, we prepared the test sample of the X-ray
sources previously observed by the Chandra and XMM-Newton telescopes (from now
on, test sample with optical counterparts). We gathered several hundred
SRG/eROSITA sources that can be reliably correlated with their optical
counterparts using sources from the CSC 2.0 (Chandra Source Catalog Release
2.0) and 4XMM DR10 (XMM-Newton X-ray source catalogue, data release 10). To
simulate optical fields around the SRG/eROSITA sources with no optical
counterparts in the DESI LIS, we used the test sample with counterparts after
removing all optical counterparts from it (test sample without counterparts).

Test sample creation procedure will be described below.

  1. 1.

In total, SRG/eROSITA detected 8309 point-like sources. First, we choose those
that have either one CSC source (585 cases) or one 4XMM source (788) within
$None$. From these CSC and XMM sources we choose those that have only one DESI
LIS object nearby (within the search radius $r\leavevmode\nobreak\
<\leavevmode\nobreak\ r_{\rm false}$222The search radius $r_{\text{false}}$
was calculated as $r_{\text{false}}\leavevmode\nobreak\ =\leavevmode\nobreak\
(-\ln[1-f_{\text{thresh}}]\pi^{-1}\rho_{\text{desi}}^{-1})^{1/2}\leavevmode\nobreak\
=$$$, where $\rho_{\text{desi}}\leavevmode\nobreak\
\approx\leavevmode\nobreak\ 4.7\times 10^{-3}\leavevmode\nobreak\
\text{arcsec}^{-2}$ is an average sky density of the DESI LIS objects within
LH, $f_{\text{thresh}}=0.03$ is the probability to find one source or more by
chance within $r<r_{\text{false}}$ according to the Poisson distribution with
$\lambda=\rho_{\text{desi}}$). Thus, we guarantee that the test sample purity
is at least 97% (it is higher in practice due to the additional selection
criteria). At this point the amount of the selected sources is 437 CSC and 473
4XMM sources.

  2. 2.

Then we left CSC and 4XMM sources with an X-ray flux that differs by the
factor of no more than five from the flux of the SRG/eROSITA sources closest
to them. At this point, 783 sources were selected in total (319 and 464
optical counterparts based on the CSC and 4XMM data accordingly).

  3. 3.

Further, we excluded fields containing several 4XMM sources besides the single
CSC source and vice versa (cutting the total number of counterparts in the
sample to 577). Moreover, after a visual inspection, we decided to exclude the
SRG/eROSITA sources with bright (magnitude in $r$ or $z$ filter less than 16)
DESI LIS objects within $None$ around them. We did this to clean the test
sample from the DESI LIS optical fields with bright star boguses on the
optical image. As a result, the final test sample contains 541 X-ray sources
with reliable optical counterparts.

Fig. 1 shows an example of the optical field around the SRG/eROSITA source
from the test sample with counterparts. Numerous DESI LIS objects (small
circles) are inside the bigger circle with a radius $R_{\rm match}=$$$ (the
bold solid line) with an X-ray source in its centre. An optical image in the
background was taken333We used SciServer API for Python
https://github.com/sciserver/SciScript-Python from the SDSS DR16. SRG/eROSITA
source 95 localisation area is shown by the solid circle in the centre.
Similar areas for the 4XMM DR10 and CSC 2.0 sources are also present (marked
by the plus and cross signs, respectively). Fluxes for all the mentioned X-ray
sources are shown in the legend (in erg/s/cm2). Both the XMM-Newton and
Chandra observations point at the SRG/eROSITA source’s optical counterpart.

Figure 2: An X-ray flux distribution for all the SRG/eROSITA Lockman Hole
sources (the solid line), a flux distribution for the test sample X-ray
sources (dashed line). Vertical lines mark sensitivity threshold values
$3\text{\times}{10}^{-15}$ and $10^{-14}$ erg/s/cm2 (LH threshold sensitivity
and a four-year sensitivity accordingly)

Fig. 2 shows the X-ray flux ($0.5-2$ keV) distribution for all the SRG/eROSITA
Lockman Hole sources and the flux distribution for the test sample X-ray
sources. One can see that fluxes from these samples are distributed slightly
differently.

Finally, the Lockman Hole test catalogue of reliable optical counterparts is
based on the test sample with counterparts. The test catalogue contains all
the SRG/eROSITA LH sources paired with the optical fields taken from the test
sample with counterparts. We used a bootstrap procedure to get an optical
field for an X-ray source. We also used the dependency shown in Fig. 15 by the
solid line to predict that an X-ray source has an optical counterpart (in a
predefined photometric catalogue). If the simulation showed that an X-ray
source $X$ has an optical counterpart, then an optical field was chosen by
chance from the test sample with counterparts (but only from the sources with
the flux close enough to the $X$’s flux). Otherwise, an X-ray source does not
have a counterpart. Then, we paired this source with an optical field sampled
from the whole test sample without counterparts (regardless of X-ray fluxes).
All the sampling was done with replacement.

##  3 Model

For every SRG/eROSITA source, our optical cross-match model has to calculate
1) a probability that this X-ray source has a counterpart in a predefined
photometric survey and 2) a probability for every optical candidate to be a
counterpart. False optical candidates (objects appearing nearby the X-ray
source by chance) and counterparts belong to different distributions in
separation (see Fig. 4) and in magnitude (see Fig. 4, §3.4). Our model uses
photometric information as the effective magnitude for the optical objects
(see §3.4).

For each X-ray source ($X$), we calculate the probability $p_{\varnothing}$
that the sample of optical candidates in the $X$’s localisation area does not
contain an optical counterpart for $X$. For every optical object $o_{\rm i}$,
we will find the probability $p_{\rm match,i}$ that it is an optical
counterpart for a given X-ray source (taking into account both angular
separation and photometric information).

$X,\\{o_{\rm i}\\}$$p_{\varnothing}\geq p^{\prime}_{\varnothing}$No
counterpart$p_{\varnothing}<p^{\prime}_{\varnothing}$$\operatorname*{argmax}\limits_{o_{\rm
i}}p_{\rm match}(o_{\rm i})$ Figure 3: Counterpart search tree. On level 1
(depending on the threshold value $p^{\prime}_{\varnothing}$ of the parameter
$p_{\varnothing}$) we decide if there is a counterpart among optical
candidates. If a counterpart is present, on level 2 for every optical
candidate we calculate the probability $p_{\rm match}$ to be a counterpart. A
candidate with a largest $p_{\rm match}$ is considered to be a counterpart.

Fig. 3 shows the search tree for the X-ray source optical counterpart. Our
algorithm consists of two levels. On the first level, we calculate
$p_{\varnothing}$ based on the characteristics of the X-ray source and its
optical surroundings. If there has to be a counterpart (if
$p_{\varnothing}<p^{\prime}_{\varnothing}$), then we calculate the probability
$p_{\rm match}$ for every optical candidate on the second level. Then we
choose the most probable candidate as a counterpart.

In Subsection §3.1 we introduce effective magnitude for optical objects and
illustrate how it helps aggregate photometric information from different
filters. In §3.2, we present our cross-match model. In §3.5, two expressions
are introduced: for the probability $p_{\rm match}$ that a given candidate is
a counterpart and the probability $p_{\varnothing}$ that a given X-ray source
does not have a counterpart in a predefined photometric survey.

Figure 4: The distribution of all optical objects found within the radius
$2\sigma$ from the LH sources with the flux $$3\text{\times}{10}^{-15}$<F_{\rm
X,0.5-2}<10^{-14}$ (left graph column) and $F_{\rm X,0.5-2}>10^{-14}$
erg/s/cm2 (right graph column; see text for more details)

###  3.1 Effective magnitudes

As mentioned above, false optical candidates and counterparts belong to
different distributions in separation and magnitude (due to the known
correlation between optical and X-ray QSO flux).

To illustrate the concept we plotted the distribution of all optical objects
found within the radius $2\sigma$ from the LH sources in a different flux
bins: $$3\text{\times}{10}^{-15}$<F_{\rm X,0.5-2}<10^{-14}$ (left plot panel)
and $F_{\rm X,0.5-2}>10^{-14}$ erg/s/cm2 (right graph column). The solid line
is the distribution of all optical objects, the line with circle markers is
for false object contributions, the dashed line is the optical counterpart
contributions. We measured the number of the false objects between two circles
$None$–$None$ (with an X-ray source in their centres). Counterparts’
contribution (dashed line) was calculated by extracting the number of false
objects from the total number of candidates (taking into account both
$2\sigma$-circle and areas between $None$–$None$). It is clear that as the
X-ray flux increases, these two contributions (of false objects and
counterparts) to the total distribution become more and more separable. Fig.
4, the upper panel shows the magnitude distributions in the $z$ filter, the
middle panel is for the $g$ filter. The lower panel shows an effective
magnitude distribution (see below). 85% quantile of the counterparts’
distribution by the effective magnitude is shown by the vertical line on the
lower panel ($m_{\rm eff}=22.6$). The vertical lines on the other panels
correspond to the values calculated with the expression (1) (where $m_{\rm
eff}=22.6$).

To take into account the photometric information on the optical candidates, we
introduce the effective magnitude $m_{\rm eff}$. This parameter is defined by
the three optical filters used in the DESI LIS:

$m_{\rm eff}=(m_{g}+c_{g})\leavevmode\nobreak\ |\leavevmode\nobreak\
(m_{r}+c_{r})\leavevmode\nobreak\ |\leavevmode\nobreak\ (m_{z}+c_{z}),$ (1)

where $c_{g}$, $c_{r}$, $c_{z}$ are predefined constants. $m_{g}$, $m_{r}$,
and $m_{z}$ magnitudes are AB magnitudes. A graphical interpretation of
$m_{\rm eff}$ is shown in Fig. 5. If an optical candidate has the effective
magnitude $m_{\rm eff}$, then its AB magnitude in the $g$ filter is
$(m_{g}+c_{g})$ or its AB magnitude in the $r$ filter is $(m_{r}+c_{r})$ or
its AB magnitude in the $z$ filter is $(m_{z}+c_{z})$. The idea behind the
effective magnitude is to define the spectral flux density level which an
optical object can reach in any of the given filters. In the photometric
surveys (such as SDSS, DESI LIS, Pan-STARRS) threshold sensitivity in the red
optical filters ($z$) is significantly higher than in the blue ones ($g$).
That is why it makes sense to define $c_{g}$, $c_{r}$, $c_{z}$ so that they
correspond to the similar signal/noise ratio in the different optical filters.
We chose $c_{g}=0$, $c_{r}=0$, $c_{z}=-1.7$ which corresponds to threshold
sensitivity difference for the photometric data SDSS (Abolfathi et al. 2018).
Generally, one can consider $c_{g}$, $c_{r}$, $c_{z}$ as the hyperparameters
(as it is done in the machine learning applications) and calibrate their
values to achieve the optimal result in accordance with a cross-match task.

It is worth mentioning that the effective magnitude allows one to squeeze all
photometric information into a single parameter $m_{\rm eff}$. On the one
hand, this approach makes photometric information processing a bit imprecise,
but on the other hand, it is less complicated and more interpretable. It also
makes our model more robust to the noise and systematic errors in the data.
Further, we plan to consider more complex approaches based on the machine
learning algorithms to perform more flexible and precise photometric
information processing.

Figure 5: Effective magnitude ($m_{\rm eff}$) graphical representation.
Magnitudes in the filters $g,\ r$ and $z$ are marked on the cube’s edges (the
solid lines). The objects with a given $m_{\rm eff}$ are lying on the small
cube’s faces (bounded by the dashed lines) and their extensions to the bigger
photometric magnitudes. The excluded area lies within the dashed cube (and its
extension to the bigger photometric magnitudes).

Figure 6: The distributions in separation to the optical candidates (empty
circles) for $p_{\rm lim}=0.85$, see §3.4. The dash-dotted line is the
expected distribution of the candidates, the dashed line is the expected
distribution of the false objects. The solid line shows the expected total
distribution.

###  3.2 Positional model

An optical candidate belongs to either candidates distribution or false
objects distribution.

We introduce the optical cross-match model with the following constraints
(typical in this context; see, for example, Budavári & Loredo 2015):

  * •

The positional error function of the X-ray sources is described by the two-
dimensional normal distribution with the covariance matrix
$\begin{pmatrix}\sigma^{2}&0\\\ 0&\sigma^{2}\end{pmatrix}$.

  * •

Then the separation $r$ between the true position of an X-ray source and its
detected position (for $r\ll\pi$) is described by the Rayleigh distribution:

$\phi(r)=\frac{r}{\sigma^{2}}\exp\bigg{(}-\frac{r^{2}}{2\sigma^{2}}\bigg{)}\leavevmode\nobreak\
.$ (2)

  * •

The localisation error of the optical objects (DESI LIS) is negligibly small
compared to the X-ray sources localisation error.

  * •

The false (independent from the X-ray sources) objects distribution is Poisson
within the small area in the Lockman Hole (with the surface density $\rho$).

Suppose an X-ray catalogue contains $N_{\rm X}$ sources. Then an average
number $N_{\rm o}(r)$ of all optical candidates in a circle with the radius
$r$ is described by the following expression:

$\displaystyle N_{\rm o}(r)$ $\displaystyle=N_{\rm x}\Bigg{(}p_{\rm
c}\int_{0}^{r}\phi(r)2\pi rdr+\rho\pi r^{2}\Bigg{)}=$ (3)
$\displaystyle=N_{\rm x}\Bigg{(}p_{\rm
c}\bigg{[}1-\exp\bigg{(}\frac{-r^{2}}{2\sigma^{2}}\bigg{)}\bigg{]}+\rho\pi
r^{2}\Bigg{)}\leavevmode\nobreak\ ,$

where $p_{\rm c}(F_{\rm X,0.5-2})$ is the probability for an X-ray source with
a given flux to have a counterpart. It is important to underline the
difference between $p_{\rm c}$ and $p_{\varnothing}$. $p_{\varnothing}$ is the
probability that there is no counterpart for an X-ray source in a given
photometric catalogue considering the vicinity of this X-ray source (i.e. a
specific set of optical objects near this X-ray source); see more details in
§3.5. At the same time, $p_{\rm c}$ is the probability for an X-ray source
(with a given flux) to have a counterpart in a predefined catalogue, no
information on the specific vicinity of this X-ray source is included.

The expression for the mean amount of candidates contained inside an annulus
$i$ bounded by the circles with the radii ${r_{i},r_{i+1}}$ is the following:

$\lambda_{i}(r_{i},r_{i+1};\sigma,p_{\rm c},\rho)=N_{\rm o}(r_{i+1})-N_{\rm
o}(r_{i}).$ (4)

The probability function for the Poisson distribution:

$\Pr(\lambda_{i},k_{i})=\frac{e^{-\lambda_{i}}\lambda_{i}^{k_{i}}}{k_{i}!}.$
(5)

and the corresponding likelihood function:

$\mathscr{L}=\sum_{i}k_{i}\ln{\lambda_{i}}-\lambda_{i},$ (6)

where $k_{i}$ is the observed amount of the optical candidates in the annulus
$i$. We found parameters $\sigma,\ p_{\rm c},\ \rho$ of the model (3) through
the maximum likelihood function (6) optimisation. The optimisation was
performed in predefined bins in detection likelihood $\pazocal{L}$ and
effective magnitude $m_{\rm eff}$. To take into account the photometric
information, we built a family of the cross-match models for the optical
objects filtered with the different threshold effective magnitude $m_{\rm
eff}$. These threshold values were chosen basing on the quantiles of the
optical counterparts distribution in $m_{\rm eff}$ for every detection
likelihood range.

Figure 7: An effective magnitude vs detection likelihood $m_{\rm
eff}(\pazocal{L})$. The different lines correspond to the different threshold
quantiles of the optical counterparts distribution in the effective magnitude.

###  3.3 The relations between the model parameters and the detection
likelihood/X-ray flux.

To illustrate our method, in this Subsection we show how our cross-match model
approximates the data for the effective magnitude threshold value chosen for
$p_{\rm lim}=0.85$ (the 85th percentile of the counterparts’ distribution in
$m_{\rm eff}$; see Fig 4, vertical lines on the lower panel). In every
detection likelihood range we define some unique value of $m_{\rm eff}$ chosen
in accordance with the given $p_{\rm lim}$ ($0.85$ in this case). We also
describe parameters behaviour for the different values of the $p_{\rm lim}$.

For $p_{\rm lim}=0.85$ Fig. 6 shows the optical objects distribution in the
angular distance (within the circle $R<$$$) between the X-ray sources and the
optical candidates. The distributions are shown in the different detection
likelihood ($\pazocal{L}$) bins. As one can see the best models fit the data
quite well. Additional information is presented in the Table 1.

Fig. 7 shows the relations between the effective magnitude and the detection
likelihood for various quantiles of the optical counterparts distribution. For
a fixed $p_{\rm lim}$, $m_{\rm eff}(\pazocal{L})$ is a monotonically
decreasing dependence. The curves for the $p_{\rm lim}=50$% and $99.5$%
quantiles differ by a factor of $\sim 4-5$ in the surface density of the
optical objects.

The SRG/eROSITA exposure time does not change much in the LH, so we can use
the following expression to switch from the detection likelihood $\pazocal{L}$
to the X-ray flux in 0.5–2 keV range: $\lg(F_{\rm
X,0.5-2})=0.66\times\lg(\pazocal{L})-15.09$. This expression approximates well
the median values of the X-ray flux in the detection likelihood bins.

Figs 8, 10 and 12 show the best values of the model parameters versus the
detection likelihood (for $\rho$, $\sigma$) or the X-ray flux (for $p_{\rm
c}$). We measured errors for the $\rho$, $\sigma$, $p_{\rm c}$ in each
detection likelihood range using the likelihood ratio test (for example see
James 2006). We vary the value of a chosen parameter in the vicinity of the
likelihood optimal value ($\mathscr{L}^{\rm best}$) and calculate the maximum
likelihood for other parameters. 68% confidence intervals for the chosen
parameter match likelihood $\mathscr{L}^{\rm best}-\chi_{\text{2dof}}^{2}$.

Figure 8: The surface density of the optical objects for the different
detection likelihood ($\pazocal{L}$) bins; $p_{\rm lim}=0.85$, (see §3.4).
Figure 9: The relations between the surface density of the optical objects and
the detection likelihood — $\rho(\pazocal{L})$. The curves are shown for the
different quantiles ($p_{\rm lim}$) of the optical counterparts distribution.
The horizontal line is a surface density calculated for all of the DESI LIS
objects without any magnitude filters. See the legend on Fig. 7

####  3.3.1 $\rho$ vs $(\pazocal{L})$

The relationship between the surface density of the optical objects (selected
using the effective magnitude threshold) and the detection likelihood —
$\rho(\pazocal{L})$ — is shown on Fig. 8 (for $p_{\rm lim}=0.85$). The
hallmark here is that the surface density decreases on order as the detection
likelihood increases from $\pazocal{L}=6$ to $\pazocal{L}\approx 10^{3}$. This
happens because bright sources (on average) have bright counterparts. For
every detection likelihood range we choose unique $m_{\rm eff}$ threshold (in
this current example the $m_{\rm eff}$ threshold corresponds to the $p_{\rm
lim}=85$%).

Fig. 9 shows the dependencies between the optical objects surface density and
the detection likelihood for the different values of $p_{\rm lim}$ (quantiles
of the counterparts distribution). Without a magnitude threshold, the density
is independent of the detection likelihood (a horizontal line). The curves
$\rho(\pazocal{L})$ for $p_{\rm lim}=50$% and $99.5$% differ by a factor of
$\sim 4-5$ in the surface density. This also happens because we choose
different $m_{\rm eff}$ thresholds for different detection likelihood bins.

Figure 10: The dependency between the localisation error of the X-ray LH
sources and their detection likelihood. The solid line ($\sigma$ best fit) is
the best parametric approximation of the $\sigma(\pazocal{L})$ dependency; its
residuals are shown in the lower panel. The scatter plot is the localisation
errors $\sigma_{\rm det}$, calculated using the source-detection algorithm.
The squares ($\sigma_{\rm det}$ median) mark their median values in the
detection likelihood bins. Figure 11: The dependency between an X-ray source
localisation error and its detection likelihood — $\sigma(\pazocal{L})$. The
dependencies are measured for the different $p_{\rm lim}$ values (counterparts
distribution quantiles). The plot shows that the $\sigma(\pazocal{L})$
behaviour is independent of the $p_{\rm lim}$.

####  3.3.2 $\sigma$ vs $(\pazocal{L})$

Fig. 10 shows the dependency between the localisation error of the X-ray
sources and their detection likelihood $\sigma(\pazocal{L})$ (for $p_{\rm
lim}=0.85$). The solid circles show the optimal $\sigma$ values found in the
different $\pazocal{L}$ bins (with the corresponding errors). The scatter plot
is the localisation errors $\sigma_{\rm det}$ (calculated using the detection
algorithm) for all point-like X-ray LH sources. As one can see, the detection
algorithm (on average) underestimates the true localisation error and needs to
be calibrated using the optical data (see §4.1).

The localisation errors obtained in this work for the different detection
likelihood bins are well described by the following three-parameter dependence
(for $p_{\rm lim}=0.85$; see Fig. 10):

$\sigma(\mathscr{L};a,b,\sigma_{0})=\sqrt{a\mathscr{L}^{b}+\sigma_{0}^{2}},$
(7)

with the optimal parameters values $a=114.12\pm 17.16,\ b=-0.96\pm 0.04,\
\sigma_{0}=0.96\pm 0.12$.

Fig. 11 shows the best approximations for the dependency between the optical
objects surface density and the detection likelihood built for the different
$p_{\rm lim}$ values. The plot shows that the different $p_{\rm lim}$ values
make almost no difference for the $\sigma(\pazocal{L})$ dependency
measurement.

Figure 12: The dependency between the probability for an X-ray source to have
an optical counterpart in the DESI LIS and its X-ray flux $F_{\rm X,0.5-2}$
(for $p_{\rm lim}=0.85$). The upper panel shows the $\text{logit}(p_{\rm c})$
values, the lower — $p_{\rm c}$. Figure 13: The probability for the
SRG/eROSITA source to have an optical counterpart as a function of the X-ray
flux — $p_{\rm c}(F_{\rm X,0.5-2})$. Different curves correspond to the
different $p_{\rm lim}$ values (quantiles of the optical counterparts
distribution in $m_{\rm eff}$).

####  3.3.3 $p_{\rm c}$ vs $F_{0.5-2}$

Fig. 12 (lower panel) shows the dependency between the probability for an
X-ray source to have an optical counterpart and an X-ray flux $p_{\rm
c}(F_{\rm X,0.5-2})$ for $p_{\rm lim}=0.85$. Dots are the measured $p_{\rm c}$
values for the corresponding flux bins.

The errors calculated for $p_{\rm c}$ are not Gaussian because the probability
$p_{\rm c}$ lie within the interval $[0,1]$. To approximate the data with the
parametric dependence we modified all calculated $p_{\rm c}$ values using
logistic function

$\text{logit}(\rm p_{\rm c})=\ln{\Big{(}\frac{p_{\rm c}}{1-p_{\rm
c}}\Big{)}}\leavevmode\nobreak\ ,$ (8)

so these transformed $p_{\rm c}$ values could lie within the whole number line
($-\infty,+\infty$).

Fig. 12 (upper panel) shows the dependency between the value $\text{logit}(\rm
p_{\rm c})$ and the X-ray flux. The errors for this value are close to the
Gaussian. We approximate the dependency $\text{logit}(\rm p_{\rm c})$—
$\log{}F_{\rm X,0.5-2}$ using the following model:

$\text{logit}(p_{\rm c})=p_{1}+\frac{\text{logit}(p_{\rm
lim})-p_{1}}{1+\exp({-p_{3}[\lg(F_{\rm X,0.5-2})-p_{2}]})},$ (9)

where $p_{1}$, $p_{2}$, $p_{3}$ are the parameters of the logistic function
which was obtained using the chi-squared minimization.

The solid line on Fig. 12 (on both panels) is the best approximation of the
data with model (9). Note that to go back from $\text{logit}(\rm p_{\rm c})$
to $p_{\rm c}$ we use an inverse logistic function

$p_{\rm c}=\frac{\exp(\text{logit}(p_{\rm c}))}{1+\exp(\text{logit}(p_{\rm
c}))}.$ (10)

Fig. 13 shows the best approximations of the probability for an X-ray source
to have an optical counterpart depending on the X-ray flux $F_{\rm X,0.5-2}$.
Different curves correspond to different $p_{\rm lim}$ values. One can see
that as $p_{\rm lim}$ decreases, only the brightest candidates remain selected
(and $p_{\rm c}$ also decreases).

###  3.4 Positional-photometric model

Previously we showed how we build the positional cross-match models for the
SRG/eROSITA sources using the effective magnitude ($m_{\rm eff}$) concept.
$m_{\rm eff}$ depends on $p_{\rm lim}$ (chosen threshold quantile of the
optical counterparts distribution).

To take into account the photometric information, we created a set of 12
positional cross-match models for the set of $p_{\rm lim}$ values444We chose
the following $p_{\rm lim}$ values: $0.5$, $0.55$, $0.6$, $0.65$, $0.7$,
$0.75$, $0.8$, $0.85$, $0.9$, $0.95$, $0.99$, $0.995$ and corresponding
$m_{\rm eff}$ values. Each $m_{\rm eff}$ value for the set of models can be
represented graphically in a magnitude space as a three-dimensional figure
(see the shape constrained by the dashed lines on Fig. 5). The relationships
between $m_{\rm eff}$, model parameters and detection likelihood (or X-ray
flux) for all 12 $p_{\rm lim}$ are shown on Figs 7, 9, 11, 13.

The family of these cross-match models (calculated for different $p_{\rm lim}$
values) together with the model built using all optical data (without any
$m_{\rm eff}$ filters) we refer to as a positional-photometric cross-match
model.

###  3.5 $p_{\rm match}$ and $p_{\varnothing}$

In this Subsection we explain how we calculate the probability for an X-ray
object with a given flux and a given optical vicinity to have a counterpart in
a predefined optical survey. We also introduce a probability $p_{\rm match}$
for an optical candidate to be a counterpart.

The probability for a given optical candidate i at a distance $r_{\rm i}$ from
an X-ray source (with parameters $\sigma$ and $p_{\rm c,i}^{\rm eff}$ and the
surface density of the optical sources $\rho^{\rm eff}_{\rm i}$) to be a
counterpart is described by the following expression:

$p_{\rm match}=\frac{p_{\rm c,i}^{\rm eff}\exp\Big{(}\frac{-r_{\rm
i}^{2}}{2\sigma^{2}}\Big{)}}{p_{\rm c,i}^{\rm eff}\exp\Big{(}\frac{-r_{\rm
i}^{2}}{2\sigma^{2}}\Big{)}+2\pi\rho^{\rm eff}_{\rm
i}\sigma^{2}}\leavevmode\nobreak\ .$ (11)

Values $p_{\rm c,i}^{\rm eff},\ \rho^{\rm eff}_{\rm i}$ used here are obtained
with the positional-photometric model (see §3.4). For a given candidate we
choose a model from the set of the positional models with different $p_{\rm
lim}$ values. We choose it in such a way that the model’s $m_{\rm eff}$
appears to be as close as possible (but greater) to the candidate’s $m_{\rm
eff}$. For the candidates with the effective magnitude higher than the maximum
$m_{\rm eff}$ available in the positional-photometric model (corresponding to
$p_{\rm lim}=0.995$) we use the model built using all optical data (without
any $m_{\rm eff}$ filters): $p_{\rm c}^{\rm pos},\ \rho^{\rm pos}$.

The probability for an X-ray source with a given optical vicinity not to have
an optical counterpart we define as the following:

$p_{\varnothing}=\frac{1}{1+\frac{1}{2\pi\sigma}\sum_{i=1}^{n_{\rm
o}}\exp\Big{(}{\frac{-r_{\rm i}^{2}}{2\sigma^{2}}}\Big{)}\frac{p^{\prime}_{\rm
c,i}}{\rho^{\prime}_{\rm i}}},$ (12)

where $n_{\rm o}$ is a number of the DESI LIS optical candidates in the
vicinity of an SRG/eROSITA source (within $None$ in our case);
$p^{\prime}_{\rm c,i}=p_{\rm c}^{\rm pos}-\overline{p_{\rm c,i}^{\rm eff}}$,
$\rho^{\prime}_{\rm i}=\rho^{\rm pos}-\overline{\rho^{\rm eff}_{\rm i}}$.
Parameters $\overline{p_{\rm c,i}^{\rm eff}},\ \overline{\rho^{\rm eff}_{\rm
i}}$ as well as $p_{\rm c,i}^{\rm eff},\ \rho^{\rm eff}_{\rm i}$ are
calculated using the model with $m_{\rm eff}$ as close as possible to $m_{\rm
eff}$ of a candidate. Unlike with $p_{\rm match}$, model’s $m_{\rm eff}$
should be lower than the canditate’s $m_{\rm eff}$.

###  3.6 Metrics for assessing the quality of the cross-match and source
selection

To evaluate the overall precision of our cross-match model we use the
following metric:

$\text{Precision}_{\rm X}=\frac{\hat{N}^{\star}_{\rm c+h}}{N_{\rm
X}}\leavevmode\nobreak\ ,$ (13)

where $N_{\rm X}$ is a total number of all X-ray sources in a sample,
$\hat{N}^{\star}_{\rm c+h}=\hat{N}^{\star}_{\rm c}+\hat{N}^{\star}_{\rm h}$ is
a number of X-ray sources for which we found a correct optical match
($\hat{N}^{\star}_{\rm c}$) or figured out (correctly) that there are no
counterparts in a given photometric survey ($\hat{N}^{\star}_{\rm h}$).

To evaluate the quality of the counterpart selection process we use the
following metrics:

$\text{Recall}_{\rm c}=\frac{\hat{N}^{\star}_{\rm c}}{N_{\rm
c}}\leavevmode\nobreak\ ,$ (14)

where $N_{\rm c}$ is a total number of all X-ray sources with counterparts in
a sample.

$\text{Precision}_{\rm c}=\frac{\hat{N}^{\star}_{\rm c}}{\hat{N}_{\rm
c}}\leavevmode\nobreak\ ,$ (15)

where $\hat{N}_{\rm c}$ is a number of X-ray sources selected by our algorithm
as sources with counterparts.

To evaluate the quality of selection for sources without counterparts
(hostless) in the DESI LIS we use the following metrics:

$\text{Recall}_{\rm h}=\frac{\hat{N}^{\star}_{\rm h}}{N_{\rm
h}}\leavevmode\nobreak\ ,$ (16)

where $N_{\rm h}$ is a total number of X-ray sources without optical
counterparts in a sample ($h$ is for hostless).

$\text{Precision}_{\rm h}=\frac{\hat{N}^{\star}_{\rm h}}{\hat{N}_{\rm
h}}\leavevmode\nobreak\ ,$ (17)

where $\hat{N}_{\rm h}$ is a number of X-ray sources selected by our algorithm
as sources without counterparts.

##  4 Results and discussion

The main results of our work are the following.

In §4.1 we present the relationship $\sigma(\pazocal{L})$ between the
localisation error of the SRG/eROSITA LH X-ray sources and their detection
likelihood. This dependence was measured using the information on optical
objects surrounding the SRG/eROSITA LH sources. Analysing the relationship
$\sigma(\pazocal{L})$ and the averaged information on the localisation error
$\sigma_{\rm det}(\pazocal{L})$ we find a calibration relationship
$\sigma(\sigma_{\rm det})$ and compare it with the results from the
literature.

In §4.2 we provide the relationship between the probability for an SRG/eROSITA
LH X-ray source to have an optical counterpart (for the DESI LIS and for the
SDSS) and its X-ray flux: $p_{\rm c}(F_{\rm X,0.5-2})$.

In §4.3 we show how the counterpart searching can be improved with the
photometric information on candidates.

§4.4 contains the information on the quality of optical cross-match we achieve
for the whole SRG/eROSITA LH X-ray sample.

Finally, in §,4.5 we provide results our algorithm allows achieving in
searching optical counterparts and selecting X-ray sources without
counterparts (hostless X-ray sources).

Figure 14: Calibration relationship between an average localisation error of
point-like X-ray sources calculated 1) using the information on optical
objects surrounding the SRG/eROSITA LH sources ($\sigma_{\rm corr}$) and 2)
using the X-ray source detection algorithm eSASS ($\sigma_{\rm det}$). The
solid line is a two-parameter model; the dashed line is a three-parameter
model. The dash-dotted line is the relationship taken from Brunner et al. 2021
(measured for another field eFEDS). The dotted line is $\sigma_{\rm
corr}=\sigma_{\rm det}$.

###  4.1 Calibration of a localisation error of the SRG/eROSITA sources

One of the main characteristics of the cross-match model is the relationship
between a localisation error and detection likelihood for X-ray sources. We
measured this relationship while searching for the best model parameters in
different detection likelihood ($\pazocal{L}$) bins. We used the information
obtained from the DESI LIS on optical candidates surrounding the SRG/eROSITA
LH sources.

We found the calibration relationship between the localisation error of point-
like X-ray sources calculated using the information on optical objects
surrounding the SRG/eROSITA LH sources ($\sigma_{\rm corr}$) and using the
X-ray source detection algorithm eSASS ($\sigma_{\rm det}$). We measured the
median values of $\sigma_{\rm det}$ for X-ray sources in different detection
likelihood bins (see the square markers connected with the dashed line on Fig.
10). The calibration relationship $\sigma_{\rm corr}(\sigma_{\rm det})$ is
shown on Fig. 14. The solid and dashed lines show the best ( $\chi^{2}$
optimisation) for the two- and three-parameter models, respectively.

$\sigma_{\rm corr,1}=a\sqrt{\sigma_{\rm det}^{2}+c^{2}}\leavevmode\nobreak\ ,$
(18)

where $a=1.11\pm 0.03,\ c=0.68\pm 0.07$;

$\sigma_{\rm corr,2}=a\sqrt{\sigma_{\rm det}^{b}+c^{2}}\leavevmode\nobreak\ ,$
(19)

where $a=0.87\pm 0.08,\ b=2.53\pm 0.20,\ c=1.12\pm 0.19$.

Both models describe the data well (taking into account the errors). The
dotted line is $\sigma_{\rm corr}=\sigma_{\rm det}$. Note that on average a
localisation error $\sigma_{\rm corr}$ we estimated is higher than
$\sigma_{\rm det}$ (calculated using the eSASS algorithm).

The dash-dot line on Fig. 14 is the calibration relationship taken from
Brunner et al. 2021 (measured using the eFEDS data).

$\sigma_{\rm corr,eFEDS}=1.15\sqrt{\sigma_{\rm
det}^{2}+0.7^{2}}\leavevmode\nobreak\ .$ (20)

We can conclude that there is a good agreement between our calibration
relationship $\sigma_{\rm corr}(\sigma_{\rm det})$ and the relationship
presented in Brunner et al. 2021.

Figure 15: $p_{\rm c}$ vs $F_{\rm X,0.5-2}$. The solid line is the
relationship calculated for the DESI LIS, the dashed one is for SDSS. The
vertical lines mark the threshold values for the flux ($F_{\rm X,0.5-2}$)
$3\text{\times}{10}^{-15}$ and $10^{-14}$ erg/s/cm2.

###  4.2 $p_{\rm c}$ vs $F_{\rm X,0.5-2}$

It is essential to take into account that an optical counterpart may be absent
in a photometric catalogue. Using the SRG/eROSITA Lockman Hole data, we
measured a probability for an X-ray source with a given flux to have a
counterpart in the DESI LIS or SDSS (Fig. 15, upper and lower panel
accordingly). The best approximations (see equations 9, 10) of the
dependencies $p_{\rm c}(F_{\rm X,0.5-2})$ we measured for the DESI LIS and
SDSS are shown on Fig. 15 by the solid and dashed lines, accordingly.

Fig. 15 shows that a probability to have a counterpart $p_{\rm c}$ is $\approx
74$% and $\approx$45% for an X-ray source with $F_{\rm
X,0.5-2}\approx\leavevmode\nobreak\ $3\text{\times}{10}^{-15}$$ erg/s/cm2(for
the DESI LIS and SDSS, respectively). For $F_{\rm
X,0.5-2}\approx\leavevmode\nobreak\ 10^{-14}$ erg/s/cm2 (corresponds to the
expected four-year equatorial sensitivity for SRG/eROSITA) $p_{\rm c}$ values
are similar both for the DESI LIS and SDSS: $\approx 82$% and $\approx 75$%.
For $F_{\rm X,0.5-2}\gtrsim\leavevmode\nobreak\ 10^{-14}$ erg/s/cm2 the
fraction of X-ray objects having an optical counterpart becomes
indistinguishable for both photometric surveys in question (within the
errors).

###  4.3 Optical cross-match using the effective magnitude

False optical candidates (objects appeared nearby the X-ray source by chance)
and counterparts belong to different distributions both in separation and
magnitude. We use photometric information on candidates in a form of the
effective magnitude, $m_{\rm eff}$. This approach allows reducing the number
of missed counterparts. Fig. 16 shows the recall curves for three different
types of X-ray sources selection: 1) selection of sources having a
counterpart, no matter if it identified correctly or not (the solid line); 2)
selection of sources having a counterpart identified using only positional
information (the dash-dotted line) 3) selection of sources identified using
both positional and photometric information (the dashed line). To draw the
solid line we used optical fields containing counterparts as the positive
class objects. For the two other lines, positive class objects are the fields
where counterpart is present and identified using positional information or
both positional and photometric information.

Figure 16: The relationships between the selection recall of X-ray sources
with counterparts ($\text{Recall}_{\rm c}$) and the ratio of missed (during
the selection process) fields without optical counterparts
($\text{Recall}_{\rm h}$). The relationships are built for $F_{\rm
X,0.5-2}>$3\text{\times}{10}^{-15}$$ erg/s/cm2. The solid line shows the
result for level 1 of our cross-match model (see Fig. 3). The dashed line is
the result of the selection using both positional and photometric information
(level 2 pos+phot). The dash-dotted line is the result of the selection based
only on positional information (i.e. when choosing the closest optical
candidate as a counterpart, level 2 pos).

Fig. 16 shows that for the DESI LIS photometric information allows reducing
the number of counterparts missed during the selection process by $\approx$13%
(for X-ray sources with $F_{\rm X,0.5-2}>$3\text{\times}{10}^{-15}$$
erg/s/cm2).

###  4.4 Overall cross-match quality for the whole LH sample

The overall precision of our cross-match procedure for the SRG/eROSITA LH
sources with $F_{\rm X,0.5-2}>3\times 10^{-15}$ erg/s/cm2 is 78% (see Fig. 17,
right panel, the solid line). For sources with flux higher than $10^{-14}$ —
93% (see same figure, left panel, solid line). To calculate the overall
precision we define a correct match either as a correctly identified
counterpart or as a correctly revealed X-ray source without a counterpart.
Precision and recall vary depending on the value of $p_{\varnothing}$ (the
probability that there is no counterpart for an X-ray source in the DESI LIS
considering the vicinity of this X-ray source).

Figure 17: The overall precision (the solid line). To calculate the overall
precision we define a correct match either as a correctly identified
counterpart ($\hat{N}^{\star}_{\rm c}/N_{\rm X}$, the dashed line) or as a
correctly revealed X-ray source without a counterpart ($\hat{N}^{\star}_{\rm
h}/N_{\rm X}$, the dash-dotted line). The metrics were calculated for the DESI
LIS for two different X-ray flux thresholds. The vertical line shows
$p_{\varnothing}=0.95$.

###  4.5 Search of optical counterparts and selection of hostless X-ray
sources

When performing a cross-mach, we need two different selection regimes: with a
high precision (80% and higher) or with high recall (90% and higher). The
former regime is preferable when we search for unique and rare sources; the
latter suits the tasks similar to QSO luminosity function measurement (when
one needs to reduce the selection effects). Our model allows working in both
regimes by varying parameter $p_{\varnothing}$.

  * •

Our cross-match algorithm allows searching optical counterparts for the LH
SRG/eROSITA sources with precision 94% and recall 94% ($F_{\rm
X,0.5-2}>10^{-14}$ erg/s/cm2 the solid and dashed line on Fig. 18, upper left
panel). For an X-ray flux higher than $3\times 10^{-15}$ precision 77% while
recall 86% (the solid and the dashed line, upper right panel). These values
refer to $p_{\varnothing}=0.95$ (shown by the vertical line on Fig. 18) and
for the DESI LIS.

  * •

The algorithm allows selecting X-ray sources without optical counterparts
(hostless sources) in the DESI LIS. For $F_{\rm X,0.5-2}>10^{-14}$ erg/s/cm2
precision 77% while recall 74% (the solid and dashed line on Fig. 18, lower
left panel). For the flux higher than $3\times 10^{-15}$ precision 87% while
recall 41% (the solid and dashed line on Fig. 18, lower right panel). These
values refer to $p_{\varnothing}=0.95$.

Figure 18: Selection quality metrics for the X-ray sources with an identified
counterpart and hostless X-ray sources. The solid line shows precision for the
sources with counterparts ($\text{Precision}_{\rm c}$, upper panels) and for
the sources without counterparts ($\text{Precision}_{\rm h}$, lower panels).
The dashed line corresponds to the selection recall for the sources with
counterparts ($\text{Recall}_{\rm c}$, upper panels) and for the hostless
sources ($\text{Recall}_{\rm h}$, lower panels). The metrics were calculated
for the DESI LIS for two different X-ray flux thresholds.

##  5 Conclusions

We present a probabilistic cross-match model for the SRG/eROSITA sources
detected in the Lockman Hole (LH) area. To illustrate the method we use the
DESI Legacy Imaging Surveys optical data. To measure the effectiveness of our
method we use the X-ray data from the CSC 2.0 and 4XMM DR10 catalogues.

The main results are listed bellow:

  1. 1.

Using the optical data from the DESI LIS in the fields of X-ray sources we
measured the relationship between the localisation error of SRG/eROSITA LH
sources and their detection likelihood $\sigma(\pazocal{L})$. We found that
the average localisation error of an X-ray source $\sigma_{\rm det}$
(calculated using the X-ray source detection algorithm eSASS) can be corrected
with the following expresion: $\sigma_{\rm corr}=a\sqrt{\sigma_{\rm
det}^{b}+c^{2}}$, where $a=0.87\pm 0.08,\ b=2.53\pm 0.20,\ c=1.12\pm 0.19$.
The error is measured in arcseconds.

  2. 2.

We measured the relationship $p_{\rm c}(F_{\rm X,0.5-2})$ between the
probability for an X-ray source (with a given flux) to have a counterpart in
two photometric catalogues: the DESI LIS and SDSS. This probability equals
$\approx 74$% and $\approx$45% for X-ray sources with $F_{\rm
X,0.5-2}\approx\leavevmode\nobreak\ $3\text{\times}{10}^{-15}$$ erg/s/cm2(for
the DESI LIS and SDSS, respectively). For $F_{\rm
X,0.5-2}\approx\leavevmode\nobreak\ 10^{-14}$ erg/s/cm2 (corresponds to the
expected four-year equatorial sensitivity for SRG/eROSITA) $p_{\rm c}$ values
are similar both for the DESI LIS and SDSS: $\approx 82$% and $\approx 75$%.

  3. 3.

Our model is able to take into account both positional and photometric
information on optical candidates. We use photometric information in the form
of effective magnitude. This approach allows reducing the number of
counterparts missed during the selection process by $\approx$13% (for X-ray
sources with $F_{\rm X,0.5-2}>$3\text{\times}{10}^{-15}$$ erg/s/cm2) in
comparison with the case when only positional information is used. The overall
precision of the cross-match procedure for the SRG/eROSITA LH sources with
$F_{\rm X,0.5-2}>3\times 10^{-15}$ erg/s/cm2 is 78%. For sources with flux
higher than $10^{-14}$ — 93%. To calculate the overall precision, we define a
correct match either as a correctly identified counterpart or as a correctly
revealed X-ray source without a counterpart. Precision and recall vary
depending on the value of $p_{\varnothing}$ (the probability that there is no
counterpart for an X-ray source in the DESI LIS considering the vicinity of
this X-ray source).

  4. 4.

The model allows searching optical counterparts for the LH SRG/eROSITA sources
with precision 94% and recall 94% ($F_{\rm X,0.5-2}>10^{-14}$ erg/s/cm2). For
an X-ray flux higher than $3\times 10^{-15}$ precision 77% while recall 86%.
These values refer to $p_{\varnothing}=0.95$ and for the DESI LIS.

  5. 5.

The algorithm allows selecting X-ray sources without optical counterparts
(hostless sources) in the DESI LIS. For $F_{\rm X,0.5-2}>10^{-14}$ erg/s/cm2
precision 77% while recall 74%. For the flux higher than $3\times 10^{-15}$
precision 87% while recall 41%. These values refer to $p_{\varnothing}=0.95$.

The model will be used in the whole-sky SRG/eROSITA survey to cross-match
detected X-ray sources with different photometric catalogues.

##

This work is based on observations with the eROSITA telescope onboard the SRG
observatory. The SRG observatory was built by Roskosmos in the interests of
the Russian Academy of Sciences represented by its Space Research Institute
(IKI) in the framework of the Russian Federal Space Program, with the
participation of the Deutsches Zentrum für Luft- und Raumfahrt (DLR). The
SRG/eROSITA X-ray telescope was built by a consortium of German Institutes led
by MPE, and supported by DLR. The SRG spacecraft was designed, built,
launched, and is operated by the Lavochkin Association and its subcontractors.
The science data are downlinked via the Deep Space Network Antennae in Bear
Lakes, Ussurijsk, and Baykonur, funded by Roskosmos. The eROSITA data used in
this work were processed using the eSASS software system developed by the
German eROSITA consortium and proprietary data reduction and analysis software
developed by the Russian eROSITA Consortium. The SRGz system was developed in
the Department of High Energy Astrophysics at IKI RAS.

This work benefited from the following publicly available software:
Programming language Python, including NumPy (Harris et al., 2020) & SciPy
(Virtanen et al., 2020), Astropy (Astropy Collaboration et al., 2013, 2018),
Pandas (Wes McKinney, 2010), Matplotlib (Hunter, 2007),
CSCview555http://cda.cfa.harvard.edu/cscview/, the TOPCAT analysis program
(Taylor, 2005) and the SciServer666www.sciserver.org scientific platform.

This work was supported by grant 21-12-00343 from the Russian Science
Foundation.

## References

  * Abolfathi et al. (2018) B. Abolfathi, D. S. Aguado, G. Aguilar, C. Allende Prieto, A. Almeida, T. T. Ananna, et al.,  ApJS, 235, 42 (2018)
  * Ananna et al. (2019) T. T. Ananna, M. Salvato, S. Lamassa, C. M. Urry, N. Cappelluti, C. Cardamone, et al.,  VizieR Online Data Catalog, p. J/ApJ/850/66 (2019)
  * Astropy Collaboration et al. (2013) Astropy Collaboration, T. P. Robitaille, E. J. Tollerud, P. Greenfield, M. Droettboom, E. Bray, et al.,  A&A, 558, A33 (2013)
  * Astropy Collaboration et al. (2018) Astropy Collaboration, A. M. Price-Whelan, B. M. Sipőcz, H. M. Günther, P. L. Lim, S. M. Crawford, et al.,  AJ, 156, 123 (2018)
  * Brunner et al. (2021) H. Brunner, T. Liu, G. Lamer, A. Georgakakis, A. Merloni, M. Brusa, et al.,  arXiv e-prints, p. arXiv:2106.14517 (2021)
  * Brusa et al. (2007) M. Brusa, G. Zamorani, A. Comastri, G. Hasinger, N. Cappelluti, F. Civano, et al.,  ApJS, 172, 353 (2007)
  * Budavári & Loredo (2015) T. Budavári and T. J. Loredo,  Annual Review of Statistics and Its Application, 2, 113 (2015)
  * Civano et al. (2012) F. Civano, M. Elvis, M. Brusa, A. Comastri, M. Salvato, G. Zamorani, et al.,  VizieR Online Data Catalog, p. J/ApJS/201/30 (2012)
  * Dey et al. (2019) A. Dey, D. J. Schlegel, D. Lang, R. Blum, K. Burleigh, X. Fan, et al.,  AJ, 157, 168 (2019)
  * Evans et al. (2010) I. N. Evans, F. A. Primini, K. J. Glotfelty, C. S. Anderson, N. R. Bonaventura, J. C. Chen, et al.,  ApJS, 189, 37 (2010)
  * Harris et al. (2020) C. R. Harris, K. J. Millman, S. J. van der Walt, R. Gommers, P. Virtanen, D. Cournapeau, et al.,  Nature, 585, 357 (2020)
  * Hunter (2007) J. D. Hunter,  Computing in Science & Engineering, 9, 90 (2007)
  * James (2006) F. James,  Statistical Methods in Experimental Physics: 2nd Edition (2006)
  * Lamassa et al. (2016) S. M. Lamassa, C. M. Urry, N. Cappelluti, H. Bohringer, A. Comastri, E. Glikman, et al.,  VizieR Online Data Catalog, p. J/ApJ/817/172 (2016)
  * Lockman et al. (1986) F. J. Lockman, K. Jahoda, and D. McCammon,  ApJ, 302, 432 (1986)
  * Marchesi et al. (2019) S. Marchesi, F. Civano, M. Elvis, M. Salvato, M. Brusa, A. Comastri, et al.,  VizieR Online Data Catalog, p. J/ApJ/817/34 (2019)
  * Menzel et al. (2016) M. L. Menzel, A. Merloni, A. Georgakakis, M. Salvato, E. Aubourg, W. N. Brandt, et al.,  VizieR Online Data Catalog, p. J/MNRAS/457/110 (2016)
  * Murray et al. (2005) S. S. Murray, A. Kenter, W. R. Forman, C. Jones, P. J. Green, C. S. Kochanek, et al.,  ApJS, 161, 1 (2005)
  * Naylor et al. (2013) T. Naylor, P. S. Broos, and E. D. Feigelson,  ApJS, 209, 30 (2013)
  * Oyabu et al. (2005) S. Oyabu, M. S. Yun, T. Murayama, D. B. Sanders, K. Kawara, Y. Taniguchi, et al.,  AJ, 130, 2019 (2005)
  * Pavlinsky et al. (2021) M. Pavlinsky, A. Tkachenko, V. Levin, N. Alexandrovich, V. Arefiev, V. Babyshkin, et al.,  A&A, 650, A42 (2021)
  * Pineau et al. (2017) F. X. Pineau, S. Derriere, C. Motch, F. J. Carrera, F. Genova, L. Michel, et al.,  A&A, 597, A89 (2017)
  * Predehl et al. (2021) P. Predehl, R. Andritschke, V. Arefiev, V. Babyshkin, O. Batanov, W. Becker, et al.,  A&A, 647, A1 (2021)
  * Salvato et al. (2018) M. Salvato, J. Buchner, T. Budavári, T. Dwelly, A. Merloni, M. Brusa, et al.,  MNRAS, 473, 4937 (2018)
  * Sunyaev et al. (2021) R. Sunyaev, V. Arefiev, V. Babyshkin, A. Bogomolov, K. Borisov, M. Buntov, et al.,  A&A, 656, A132 (2021)
  * Sutherland & Saunders (1992) W. Sutherland and W. Saunders,  MNRAS, 259, 413 (1992)
  * Taylor (2005) M. B. Taylor, TOPCAT & STIL: Starlink Table/VOTable Processing Software (2005), P. Shopbell, M. Britton, and R. Ebert (eds.), Astronomical Data Analysis Software and Systems XIV
  * Virtanen et al. (2020) P. Virtanen, R. Gommers, T. E. Oliphant, M. Haberland, T. Reddy, D. Cournapeau, et al.,  Nature Methods, 17, 261 (2020)
  * Webb et al. (2020) N. A. Webb, M. Coriat, I. Traulsen, J. Ballet, C. Motch, F. J. Carrera, et al.,  A&A, 641, A136 (2020)
  * Wes McKinney (2010) Wes McKinney, Data Structures for Statistical Computing in Python (2010), Stéfan van der Walt and Jarrod Millman (eds.), Proceedings of the 9th Python in Science Conference

## Appendix

№ | ${\pazocal{L}}_{\rm left}$ | ${\pazocal{L}}_{\rm right}$ | $\widetilde{\pazocal{L}}$ | $\tilde{\sigma}_{\rm det}$ | $\sigma$ | $\rho$ | $p_{\rm c}$ | $m_{\rm eff}$ | $\mathscr{L}$ | $n_{\rm optical}$ | $n_{\rm xray}$
---|---|---|---|---|---|---|---|---|---|---|---
0 | 6.00 | 10.44 | 7.88 | 3.32 | $4.28_{-0.22}^{+0.22}$ | $9.11_{-0.16}^{+0.06}$ | $0.59_{-0.05}^{+0.03}$ | 23.15 | -59362.77 | 12796 | 1653
1 | 10.44 | 18.17 | 13.70 | 2.70 | $3.22_{-0.14}^{+0.11}$ | $7.84_{-0.09}^{+0.05}$ | $0.63_{-0.04}^{+0.03}$ | 22.96 | -42495.91 | 9762 | 1438
2 | 18.17 | 31.62 | 23.63 | 2.20 | $2.43_{-0.08}^{+0.06}$ | $6.42_{-0.10}^{+0.05}$ | $0.66_{-0.03}^{+0.02}$ | 22.68 | -27814.70 | 6950 | 1219
3 | 31.62 | 55.24 | 41.48 | 1.79 | $2.18_{-0.09}^{+0.07}$ | $5.55_{-0.14}^{+0.07}$ | $0.70_{-0.04}^{+0.02}$ | 22.45 | -16972.17 | 4716 | 933
4 | 55.24 | 96.50 | 70.98 | 1.45 | $1.76_{-0.07}^{+0.05}$ | $2.74_{-0.11}^{+0.04}$ | $0.72_{-0.04}^{+0.03}$ | 21.54 | -5088.33 | 1868 | 651
5 | 96.50 | 168.58 | 118.30 | 1.17 | $1.45_{-0.07}^{+0.05}$ | $2.35_{-0.14}^{+0.07}$ | $0.77_{-0.05}^{+0.04}$ | 21.32 | -2245.76 | 1025 | 394
6 | 168.58 | 294.49 | 216.14 | 0.95 | $1.23_{-0.07}^{+0.07}$ | $2.03_{-0.18}^{+0.11}$ | $0.77_{-0.06}^{+0.06}$ | 20.92 | -864.96 | 544 | 231
7 | 294.49 | 514.45 | 374.95 | 0.78 | $1.10_{-0.06}^{+0.06}$ | $1.62_{-0.13}^{+0.09}$ | $0.84_{-0.08}^{+0.08}$ | 20.45 | -360.85 | 307 | 146
8 | 514.45 | 898.70 | 626.75 | 0.62 | $1.14_{-0.10}^{+0.09}$ | $0.81_{-0.16}^{+0.12}$ | $0.88_{-0.12}^{+0.08}$ | 19.99 | -23.92 | 90 | 60
9 | 898.70 | 1569.94 | 1075.39 | 0.50 | $0.96_{-0.11}^{+0.12}$ | $0.81_{-0.19}^{+0.17}$ | $0.86_{-0.14}^{+0.08}$ | 19.59 | 4.97 | 62 | 39
Table 1: Limits for the detection likelihood ($\pazocal{L}$) bins and median
values of $\pazocal{L}$ in these bins are shown in columns ${\pazocal{L}}_{\rm
left}$, ${\pazocal{L}}_{\rm right}$ and $\widetilde{\pazocal{L}}$. Column
$\tilde{\sigma}_{\rm det}$ contains the median values of the localisation
error $\sigma_{\rm det}$. In columns $\sigma$, $\rho$, $p_{\rm c}$ model
parameters are presented with their errors; $\mathscr{L}$ is for the maximum
likelihood function values used in §3.2; $m_{\rm eff}$ is for the effective
magnitude thresholds in corresponding bins; $n_{\rm xray}$ is a total number
of the X-ray sources; $n_{\rm optical}$ is a total number of the optical
sources taken form the fields of X-ray sources (within $None$). All model
parameters are calculated for $p_{\rm lim}=0.85$ (see §3.4).


# Smooth values of some quadratic polynomials

Filip Najman
University of Zagreb, Croatia

###### Abstract

In this paper, using a method of Luca and the author, we find all values $x$
such that the quadratic polynomials $x^{2}+1,$ $x^{2}+4,$ $x^{2}+2$ and
$x^{2}-2$ are $200$-smooth and all values $x$ such that the quadratic
polynomial $x^{2}-4$ is $100$-smooth.

Keywords Pell equation, Compact representations, Lucas sequences.
Mathematics Subject Classification (2000) 11D09, 11Y50.

##  1 Introduction.

For any integer $n$ we let $P(n)$ be the largest prime factor of $n$ with the
convention $P(0)=P(\pm 1)=1$. We say that a integer $s$ is $m$-smooth if
$P(s)<m$. In 1964, Lehmer [8] found all positive integer solutions $x$ to the
inequality $P(x(x+1))\leq 41$. Notice that this amounts to finding all odd
positive integers $y=2x+1$ such that $P(y^{2}-1)\leq 41$. There are $869$ such
solutions. In [9], Luca found all positive integer solutions of the similar
looking inequality $P(x^{2}+1)<100$. There are $156$ of them. In [6], Guzmán
Sánchez found the largest solutions of $P(x^{2}+2)<100$ and $P(x^{2}-2)<100$.
Recently, Luca and the author, in [10] extended Lehmer’s results, finding all
the solutions to $P(x^{2}-1)<100$. There are $16167$ solutions of this
inequality.

In this paper, we find all the positive integer $x$ that are a solution to the
inequalities

$P(x^{2}+1)<200,$ (1)

extending Luca’s results,

$P(x^{2}+4)<200,$ (2) $P(x^{2}-4)<100,$ (3) $P(x^{2}+2)<200,$ (4)

and

$P(x^{2}-2)<200.$ (5)

By solving (4) and (5) we will extend the results of Guzmán Sánchez (see [6]).

When considering the inequality (3), we have to consider all the primes in the
factorization of $x^{2}-4$ (except $2$, as we will later see), while when
considering (1) and (2) we can disregard the primes congruent to $3$ modulo
$4$ and when considering (4) and (5) we need only consider the prime $2$ and
the primes congruent to $1$ or $3$ modulo $8$ for (4) and the primes congruent
to $1$ or $7$ modulo $8$ for (5). This is the reason we can only find
$100$-smooth values of $x^{2}-4$, compared to $200$-smooth values of all the
other quadratic forms.

In [8], [9] and [10] the following approach was taken. Assume that $x$ is a
positive integer such that $P(x^{2}\pm 1)\leq K$ for the appropriate $K$. Then
we can write

$x^{2}\pm 1=dy^{2},$ (6)

where $d$ is squarefree, and $P(dy)\leq K$. This implies that only a small
number $n$ of primes participates in the factorization of $d$. For example,
$n=13$ for $P(x^{2}-1)\leq 41$ (as in [8]), $n=12$ for $P(x^{2}+1)<100$ (as in
[9]) and $n=25$ for $P(x^{2}-1)<100$ (as in [10]). In all the cases, we can
write equation (6) in the form

$x^{2}-dy^{2}=\mp 1.$

Thus, our possible values for $x$ appear as the first coordinate of one of the
solutions of at most $2^{n}-1$ Pell equations. For a given Pell equation, the
sequence $(y_{n}/y_{1})_{n\geq 1}$ forms a Lucas sequence with real roots. The
Primitive Divisor Theorem for Lucas sequences with real roots (see, for
example, [4], or the more general result from [1] which applies to all Lucas
sequences) says that if $n>6$, then $y_{n}$ has a prime factor which is at
least as large as $n-1$. In the mentioned papers it suffices to check the
first $42,\ 98$ and $98$ values respectively of the component $x$ of the Pell
equations involved and among these one finds all possible solutions of the
equations considered.

It is easy to see that in these calculations the number of equations becomes
huge. An even bigger problem are the coefficients of the Pell equations, as
the size of the solutions grows exponentially in respect to $d$. This means
that just _writing down_ the solution takes exponential time. This is why in
[10] _compact representations_ of the solutions to the Pell equations were
used. A compact representation of an algebraic number
$\beta\in\mathbb{Q}(\sqrt{d})$ is a representation of $\beta$ of the form

$\beta=\prod_{j=1}^{k}\left(\frac{\alpha_{j}}{d_{j}}\right)^{2^{k-j}},$ (7)

where $d_{j}\in\mathbb{Z},\
\alpha_{j}={(a_{j}+b_{j}\sqrt{d})}/2\in\mathbb{Q}(\sqrt{d}),\
a_{j},b_{j}\in\mathbb{Z},\ j=1,\ldots,k$, and $k$, $\alpha$ and $d_{j}$ have
$O(\log d)$ digits. A detailed description of compact representations and
their use can be found in [7]. Using compact representation cuts down the
space needed from exponential to polynomial in respect to $d$ and the time
needed to compute the regulator of the appropriate real quadratic field from
exponential to subexponential. Without the use of compact representations, the
results of [10] would be hopelessly unattainable. For comparison, in [8] 8191
equations were considered, the largest of them having $d=304250263527210$ and
the largest solution having less than $8600$ digits, while in [10] $33554431$
equations were considered, the largest of them having
$d=2305567963945518424753102147331756070$, and many of the solutions having
billions of digits.

In this paper, we will use the same strategy to improve on the results of [9]
concerning the inequality (1), using compact representations where standard
representations were previously used. In examining the inequalities (2) and
(3) we will consider fundamental units $\eta_{d}$ of the quadratic fields
$\mathbb{Q}(\sqrt{d})$ satisfying the condition that the cube of $\eta_{d}$ is
the fundamental solution of the Pell equation $x^{2}-dy^{2}=-1$ for the case
(2) and $x^{2}-dy^{2}=1$ for the case (3). When considering the inequalities
(4) and (5), we will use the fact that if $\nu$ is the smallest solution of
the equation $x^{2}-dy^{2}=\pm 2$, then $\nu^{2}/2=\eta_{d}$. This means that
all the solutions of $x^{2}-dy^{2}=\pm 2$ are of the form $\nu^{2n+1}/2^{n}$.
One can show that the solutions form a _Lehmer sequence_ with real roots, and
by a result of Ward (see [14], and [1] for a more general result), we again
have control over the prime factors of the members of the sequence. Again, it
is necessary to use compact representations when representing the solutions of
all these equations.

Note that $k=\pm 1,\pm 2,\pm 4$ are the only values of $k$ such that the
integer solutions $x$ to the inequality $P(x^{2}+k)<M$, for some bound $M$,
can be determined in this manner. This is because only for these cases do the
solutions of the corresponding equations form either a Lucas or Lehmer
sequence. Buchmann, Győry, Mignotte and Tzanakis found all solutions of
$P(x^{3}+1)<31$, which leads to $P(x^{2}+3)<31$ in [3]. They did this by a
case by case study and considered each of the Pellian equations (there are
$16$ of them) separately.

##  2 The inequality $P(x^{2}+1)<200$.

Let $x$ be a integer such that $x^{2}+1$ is $200$-smooth. By a classical
result of Fermat, a number can be represented as a sum of to squares only if
it has no prime divisors congruent to $3$ modulo $4$. This means that
$x^{2}+1$ can be divisible only by $2$ and the $21$ primes congruent to $1$
modulo $4$ up to $200$. We can now write $x^{2}+1=dy^{2}$, i.e.
$x^{2}-dy^{2}=-1$, where

$d=2^{a_{1}}\cdot 5^{a_{2}}\cdots 197^{a_{22}},\ a_{i}\in\\{0,1\\}\text{ for
}i=1,\ldots 22.$

This is a negative Pell equation, so $(x,y)=(X_{n},Y_{n})$, where
$X_{n}+Y_{n}\sqrt{d}=(X_{1}+Y_{1}\sqrt{d})^{2n+1}$, for some positive integer
$n$ and $X_{1}+Y_{1}\sqrt{d}$ being the fundamental solution of the negative
Pell equation. We have $2^{22}-1=4194303$ equations that we need to consider.
The largest $d$ appearing is $d=940258296925944608662895221235664431210$. Note
that this $d$ is more than $400$ times larger than any $d$ appearing in [10].

One can easily check that $Y_{1}$ divides $Y_{n}$. We define
$u_{n}=\frac{Y_{n}}{Y_{1}}$. The sequence $(u_{n})$ is a Lucas sequence of the
first kind with real roots $\eta$ and $\zeta$. By a result of Carmichael (see
[4]), the Primitive Divisor Theorem, this implies that for every $n>12,u_{n}$
has a _primitive divisor_ $p$, a prime satisfying, among other properties,
$p\equiv\pm 1\pmod{n}$. This implies that for $n>200$, there exists a prime
$p\geq 200$ dividing $u_{n}$. Thus, only the first $200$ values of $(Y_{n})$
can possibly be $200$-smooth. This means that we only need to consider the
first $200$ solutions of each negative Pell equation.

We will follow the methods of [10] very closely, so we will give only an
outline of the algorithm (for a detailed explanation of each step see [10]).
The algorithm that finds all the solutions goes through all the possible
values $d$ and for each, does the following: First it computes the regulator
of the quadratic field $\mathbb{Q}(\sqrt{d})$ using Buchmann’s subexponential
algorithm (see [2]). The results of this algorithm are dependent on the
Generalized Riemann hypothesis. Next, using the computed regulator, we
construct a compact representation of the fundamental solution
$X_{1}+Y_{1}\sqrt{d}$ of the negative Pell equation $x^{2}-dy^{2}=-1$, using
the methods from [11]. Now, using the algorithm for modular arithmetic
described in [12], we check whether $Y_{1}$ is $200$-smooth. If it is, then we
check which of the $Y_{n},\ 2\leq n\leq 200$ is $200$-smooth. Each
$200$-smooth value of $Y_{n}$ gives us a solution $X_{n}$ of our problem. If
$Y_{1}$ is not $200$-smooth, then no $Y_{n}$ will be. There is one last check
that needs to be done: compute all the convergents $\frac{p_{n}}{q_{n}}$ of
the continued fraction expansion of $\sqrt{d}$ such that $q_{n}<z$, where $z$
is the $200$-smooth part of $Y_{1}$, and check whether there exists a
convergent $\frac{p_{n}}{q_{n}}$ such that $p_{n}^{2}-q_{n}^{2}=-1$. This test
removes the dependence of our results on the Generalized Riemann hypothesis.
In all tested cases it failed, as if a convergent $\frac{p_{n}}{q_{n}}$
satisfying the test were to be found, it would imply that the Generalized
Riemann hypothesis is false.

We obtain the following results:

######  Theorem 1.

  * a)

The largest three solutions of the equation $P(x^{2}+1)<200$ are
$x=69971515635443$, $120563046313$ and
$104279454193$.

  * b)

The largest solution of $P(x^{4}+1)<200$ is $x=10$.

  * c)

The largest solution of $P(x^{6}+1)<200$ is $x=8$.

  * d)

The largest $n$ such that $P(x^{2n}+1)<200$ has a solution is $n=9$, the
solution being $x=2$.

  * e)

The inequality $P(x^{2}+1)<200$ has $811$ solutions.

  * f)

The greatest power $n$ of the fundamental solution of the negative Pell
equation $(X_{1}+Y_{1}\sqrt{d})^{n}$ which leads to a solution of our problem
is $n=9$ for $d=5$. The case $d=5$ also gives us most solutions, namely $4$ of
them.

_Proof:_
Part b) is proved by finding the largest square of all the $x$, c) by finding
the largest a cube, etc. ∎

##  3 The inequality $P(x^{2}+4)<200$.

Obviously, $P(x^{2}+1)<200$ iff $P((2x)^{2}+4)<200$. Thus, we have allready
obtained all the even solutions to the inequality (2). It remains to find the
odd solutions. Let $\eta_{d}=\frac{u+v\sqrt{d}}{2}$ be the fundamental unit of
the quadratic field $\mathbb{Q}(\sqrt{d})$ and $x_{1}+y_{1}\sqrt{d}$ the
fundamental solution of the Pell equation $x^{2}-dy^{2}=1$. Then
$x_{1}+y_{1}\sqrt{d}=\eta_{d}^{n}$, where $n=1,2,3$ or $6$, and the exact
value can be found by examining $u$ and $v$ modulo $8$, from the following
table:

$d$ | $v$ | $u$ | $n$
---|---|---|---
$d\equiv 1\pmod{4}$ | $v\equiv 0\pmod{4}$ | $-$ | $1$
| $v\equiv 2\pmod{4}$ | $-$ | $2$
$d\equiv 5\pmod{16}$ | $v\equiv 1\pmod{2}$ | $u\equiv\pm 3v\pmod{8}$ | $3$
|  | $u\equiv\pm v\pmod{8}$ | $6$
$d\equiv 13\pmod{16}$ | $v\equiv 1\pmod{2}$ | $u\equiv\pm v\pmod{8}$ | $3$
|  | $u\equiv\pm 3v\pmod{8}$ | $6$
$d\equiv 2\pmod{4}$ | $v\equiv 0\pmod{2}$ | $-$ | $1$
| $v\equiv 1\pmod{2}$ | $-$ | $2$
$d\equiv 3\pmod{4}$ | $-$ | $-$ | $1$

Table 1

It is easy to see that $x^{2}-dy^{2}=-4$ will have a solution iff $n=6$ in
Table 1, and then the solutions will be of the form

$X_{m}+Y_{m}\sqrt{d}=2\eta_{d}^{k},$

where $k\equiv\pm 1\pmod{6}$. Also, one can see that $n=6$ only if $d\equiv
5\pmod{8}$. This also means that we do not have to consider $2$ in the
factorization of $d$, leaving only the $21$ primes congruent to $1$ modulo
$4$.

Using the same algorithm from Section 2, with the appropriate minor changes,
we obtain the following results.

######  Theorem 2.

  * a)

The largest three odd solutions of the equation $P(x^{2}+4)<200$ are
$x=191686681859$, $112899039159$ and $28608252345$.

  * b)

The largest odd solution of $P(x^{4}+4)<200$ is $x=923$.

  * c)

There are no odd solutions to $P(x^{2n}+4)<200$ for $n\geq 3$.

  * d)

The inequality $P(x^{2}+4)<200$ has $344$ odd solutions.

  * f)

The greatest power $n$ of the smallest solution of our problem
$(X_{1}+Y_{1}\sqrt{d})^{n}$ which leads to a solution is $n=19$ for $d=5$. The
case $d=5$ also gives the most solutions, namely $5$ of them.

##  4 The inequality $P(x^{2}-4)<100$.

Obviously, $P(x^{2}-1)<100$ iff $P((2x)^{2}-4)<100$. Thus, we have already
obtained in [10] all the even solutions to the inequality (2). It remains to
find the odd solutions. Again, let $\eta_{d}=\frac{u+v\sqrt{d}}{2}$ be the
fundamental unit of the quadratic field $\mathbb{Q}(\sqrt{d})$ and
$x_{1}+y_{1}\sqrt{d}$ the fundamental solution of the Pell equation
$x^{2}-dy^{2}=1$, and $x_{1}+y_{1}\sqrt{d}=\eta_{d}^{n}$, where $n$ can be
found in Table 1. It is easy to see that $x^{2}-dy^{2}=4$ will have a solution
iff $n=3$ in Table 1, and then the solutions will be of the form

$X_{m}+Y_{m}\sqrt{d}=2\eta_{d}^{k},$

where $k\not\equiv 0\pmod{3}$. Again, one can see that $n=3$ only if $d\equiv
5\pmod{8}$, so once again we can disregard the prime $2$ in the factorization
of $d$.lready obtained in [10] all the even solutions to the inequality (2).
It remains to find the odd solutions. Again, let
$\eta_{d}=\frac{u+v\sqrt{d}}{2}$ be the fundamental unit of the quadratic
field $\mathbb{Q}(\sqrt{d})$ and $x_{1}+y_{1}\sqrt{d}$ the fundamental
solution of the Pell equation $x^{2}-dy^{2}=1$, and
$x_{1}+y_{1}\sqrt{d}=\eta_{d}^{n}$, where $n$ can be found in Table 1. It is
easy to see that $x^{2}-dy^{2}=4$ will have a solution iff $n=3$ in Table 1,
and then the solutions will be of the form

$X_{m}+Y_{m}\sqrt{d}=2\eta_{d}^{k},$

where $k\not\equiv 0\pmod{3}$. Again, one can see that $n=3$ only if $d\equiv
5\pmod{8}$, so once again we can disregard the prime $2$ in the factorization
of $d$.

Using the same algorithm from Section 2, with the appropriate minor changes,
we obtain the following results.

######  Theorem 3.

  * a)

The largest three odd solutions of the equation $P(x^{2}-4)<100$ are
$x=407479035814853$, $335682488669673$ and
$250734674482437$.

  * b)

The largest odd solution of $P(x^{4}-4)<100$ is $x=59$.

  * c)

The largest odd solution of $P(x^{6}-4)<100$ is $x=7$.

  * d)

The largest $n$ such that $P(x^{2n}-4)<100$ has a solution is $n=7$, the
solution being $x=3$.

  * e)

The inequality $P(x^{2}-4)<100$ has $2846$ odd solutions.

  * f)

The greatest power $n$ of the smallest solution of our problem
$(X_{1}+Y_{1}\sqrt{d})^{n}$ which leads to a solution of our problem is $n=10$
for $d=5$. The case $d=5$ also gives the most solutions, namely $7$ of them.

##  5 The inequality $P(x^{2}+2)<200$.

Consider the equation $x^{2}-dy^{2}=\pm 2$, where $d$ is square free, and let
$x_{1}+y_{1}\sqrt{d}=\nu$ be the least solution. Obiviously, $d\equiv
2,3\pmod{4}$ has to hold. One can see that, using the notation from Table 1,
this implies $n=1$ or $2$. From a result of Perron (see [13, p. 126-129]), if
$d\neq 2$, at most one of the equations $x^{2}-dy^{2}=-1$, $x^{2}-dy^{2}=2$
and $x^{2}-dy^{2}=-2$ is solvable. This implies that $n=2$ is impossible. By a
elementary argument (see for example [7, p. 420]), one can also show that
$\nu^{2}/2=\eta_{d}$ holds. This can be reformulated in terms of the
infrastructure of a real quadratic field by saying the ideal with norm $\pm 2$
appears half way through the cycle of the principal class, or in terms of
continued fractions by saying that the $p_{l/2}^{2}-dq_{l/2}^{2}=\pm 2$, where
$l$ is the length of the continued fraction expansion of $\sqrt{d}$. Thus all
the solutions of $x^{2}-dy^{2}=\pm 2$ are of the form

$x_{k}+y_{k}\sqrt{d}=\nu\eta_{d}^{k}=\frac{\nu^{2k+1}}{2^{k}},\ \text{ for
}k\leq 0.$

Now let

$\alpha=\frac{x_{1}+y_{1}\sqrt{d}}{\sqrt{2}}\text{ and
}\beta=\frac{x_{1}-y_{1}\sqrt{d}}{\sqrt{2}}.$

Then

$y_{k}=\frac{\alpha^{k}-\beta^{k}}{\sqrt{2d}},$

and

$u_{k}=\begin{cases}\frac{y_{k}}{y_{1}}\text{ if $k$ is odd}\\\
\frac{y_{k}}{y_{2}}\text{ if $k$ is even}\\\ \end{cases}$

is a Lehmer sequence. Note that only the odd members of this sequence yield a
solution to our equation. Thus, by the Primitive divisor theorem for Lehmer
sequences (see [14] and [1]), only the first $100$ odd members of the sequence
$(u_{k})_{k\geq 0}$ can possibly be $200$-smooth.

To narrow down our search we will use the following results of Yokoi:

######  Theorem 4.

([15, Theorems 1 and 2])
Let $t+u\sqrt{d}$, where $d$ is a squarefree positive integer congruent to $2$
or $3$ modulo $4$, be the fundamental unit of the real quadratic field
$\mathbb{Q}(\sqrt{d})$.
a) The Diophantine equation $x^{2}-dy^{2}=2$ is solvable if and only if
$t\equiv 1\pmod{d}$.
b) The Diophantine equation $x^{2}-dy^{2}=-2$ is solvable if and only if
$t\equiv-1\pmod{d}$.

######  Proposition 5.

([15, Proposition 2])
a) If the Diophantine equation $x^{2}-dy^{2}=2$ is solvable then $p\equiv\pm
1\pmod{8}$ for any odd prime factor $p$ of $d$.
b) If the Diophantine equation $x^{2}-dy^{2}=-2$ is solvable then $p\equiv
1\text{ or }3\pmod{8}$ for any odd prime factor $p$ of $d$.

Using Theorem 4 and Proposition 5 to narrow down our search, we procced in the
same manner as for (1), (2) and (3). We obtain the following results:

######  Theorem 6.

  * a)

The largest three odd solutions of the equation $P(x^{2}+2)<200$ are
$x=9575480365630$, $14629598023$ and $8850900308$.

  * b)

The largest odd solution of $P(x^{4}+2)<200$ is $x=171$.

  * c)

The largest solution of $P(x^{6}+2)<200$ is $x=3$.

  * d)

The largest $n$ such that $P(x^{2n}+2)<200$ has a solution is $n=5$, the
solution being $x=2$.

  * e)

The inequality $P(x^{2}+2)<200$ has $914$ solutions, of which $516$ are odd
and $398$ are even.

  * f)

The greatest power $n$ such that

$\frac{(X_{1}+Y_{1}\sqrt{d})^{2n+1}}{2^{n}}$

leads to a solution of our problem is $n=8$ for $d=2$. The case $d=3$ gives
the most solutions, namely $6$ of them.

##  6 The inequality $P(x^{2}-2)<200$.

We search for the solutions of this inequality as explained in the previous
section, again using Theorem 4 and Proposition 5 to narrow down our search. We
obtain the following results:

######  Theorem 7.

  * a)

The largest three solutions of the equation $P(x^{2}-2)<200$ are
$x=324850200677887$, $1600947755823$ and $494400410248$.

  * b)

The largest solution of $P(x^{4}-2)<200$ is $x=47$.

  * c)

The largest odd solution of $P(x^{6}-2)<200$ is $x=10$.

  * d)

The largest $n$ such that $P(x^{2n}-2)<200$ has a solution is $n=5$, the
solution being $x=2$.

  * e)

The inequality $P(x^{2}-2)<200$ has $537$ solutions, of which $313$ are even
and $224$ are odd.

  * f)

The greatest power $n$ such that

$\frac{(X_{1}+Y_{1}\sqrt{d})^{2n+1}}{2^{n}}$

leads to a solution of our problem is $n=7$ for $d=2$. The case $d=2$ also
gives the most solutions, namely $5$ of them.

Problem number $4$ on the list [5] of open problems concerning Diophantine
equations is to find all the solutions $(x,y,p)$ to

$x^{2}-2=y^{p},$

where $p$ is a odd prime. By searching through our solutions we prove the
following proposition.

######  Proposition 8.

If the Diophantine equation $x^{2}-2=y^{p}$, where $p$ is an odd prime, then
$P(y)>200$.

Remark. The tables produced by our computations can be found on the web page
http://web.math.hr/~fnajman.

Acknowledgements. Many thanks go to Florian Luca for pointing out that this
method will work for $x^{2}\pm 2$. I am also grateful to Andrej Dujella and
the referee for many helpful comments.

## References

  * [1] Yu. Bilu, G. Hanrot, P. M. Voutier, _Existence of primitive divisors of Lucas and Lehmer numbers. With an appendix by M. Mignotte_ , J. Reine Angew. Math. 539 (2001), 75–122.
  * [2] J. Buchmann, _A subexponential algorithm for the determination of class groups and regulators of algebraic number fields_ , Séminaire de Théorie des Nombres (1990), 27-41.
  * [3] J. Buchmann, K. Győry, M. Mignotte, N. Tzanakis, _Lower bounds for $P(x^{3}+k)$, an elementary approach_, Publ. Math. Debrecen 38 (1991), 145–163.
  * [4] R. D. Carmichael, _On the numerical factors of the arithmetic forms $\alpha^{n}\pm\beta^{n}$_, Ann. of. Math. 15 (1913), 30–70.
  * [5] J. H. Evertse, R. Tijdeman, _Some open problems about Diophantione equations_ from a workshop in Leiden in May 2007, see http://www.math.leidenuniv.nl/~evertse/07-workshop-problems.pdf
  * [6] S. Guzmán Sánchez, _Factores primos de $x^{2}\pm 2$_, Bachelor Thesis, Universidad de Guanajuato, Guanajuato, México (2008)
  * [7] M. J. Jacobson Jr., H. C . Williams, _Solving the Pell Equation_ , Springer, 2009.
  * [8] D. H. Lehmer, _On a problem of Störmer_ , Illinois J. Math 8 (1964), 57–79.
  * [9] F. Luca, _Primitive divisors of Lucas sequences and prime factors of $x^{2}+1$ and $x^{4}+1$_, Acta Acad. Paedagog. Agriensis Sect. Mat. (N.S.) 31 (2004), 19–24.
  * [10] F. Luca, F. Najman, _On the largest prime factor of $x^{2}-1$_, Math. Comp., to appear.
  * [11] M. Maurer, _Regulator approximation and fundamental unit computation for real quadratic orders_ , PhD thesis, Technische Universit at Darmstadt, Fachbereich Informatik, Darmstadt, Germany, 2000.
  * [12] F. Najman, _Compact representation of quadratic integers and integer points on some elliptic curves_ , Rocky Mountain J. Math., to appear.
  * [13] O. Perron, _Die Lehre von den Kettenbruchen_ , Chelsea Publ. Comp., 1929.
  * [14] M. Ward, _The Intrinsic Divisors of Lehmer Numbers_ , Ann. of Math. (2) 62 (1955), 230–236.
  * [15] H. Yokoi, _Solvability of the Diophantine equation $x^{2}-Dy^{2}=\pm 2$ and new invariants for real quadratic fields_, Nagoya Math. J. 134 (1994), 137–149.

Department of Mathematics, University of Zagreb, Bijenička cesta 30, 10000
Zagreb, Croatia
<EMAIL_ADDRESS>