# A JPEG-based image coding solution
for data storage on DNA ††thanks: This project has received funding from the
European Union’s Horizon 2020 research and innovation programme under grant
agreement No 863320.

Melpomeni Dimopoulou1, Eva Gil San Antonio2, Marc Antonini3 Université Côte
d’Azur, CNRS
Laboratoire I3S, UMR 7271
Sophia Antipolis, France
<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>
###### Abstract

The efficient storage of digital data is becoming very challenging over the
years due to the exponential increase in the generation of data which can’t
compete with the existing storage resources. Furthermore, the infrequently
accessed data can be safely stored for no longer than 10-20 years due to the
short life-span of conventional storage devices. To this end, recent studies
have proven DNA to be a very promising candidate for the long-term storage of
digital data. Several pioneering works have proposed different encoding
methods for the specific encoding of images into a quaternary DNA
representation while first compressing the image using the classical JPEG
standard to reduce the high cost of DNA synthesis. However this type of
compression is not optimized with respect to the quaternary DNA code and
results in an open-loop workflow. In our previous works we have introduced the
first closed-loop solution for generating a constrained fixed-length
quaternary code which allows controlling the synthesis cost thanks to a source
allocation algorithm. In this paper, we extend our studies to proposing a
variable-length encoding solution which is based on the JPEG standard.

###### Index Terms:

DNA data storage, Image Compression, Robust encoding, JPEG standard, variable-
length coding

##  I Introduction

The exponential growth of the digital universe imposes a great challenge in
the storage of digital data which is handled by large data centers. An
important fraction of this data is accessed infrequently but needs to be
safely stored due to security and regulatory compliance reasons. Such data is
characterized as cold and is normally stored into off-line back up tape drives
which constitute a cheaper means of storage. Nevertheless, conventional
storage devices have a limited life-span varying from 10 to 20 years and
therefore data needs to be frequently migrated into new storage units, a fact
which causes huge energy and hardware waste and is expensive in terms of
money. To this end, studies have recently proposed the use of DNA as a novel
and promising means of digital data storage which can store 215 petabytes in a
single gram and can promise reliable storage for hundreds of years. This last
claim can be proven by the successful retrieval and decoding of the DNA of a
woolly mammoth that had been trapped into permafrost. DNA is the storage
medium of heredity information and consists of 4 different building blocks,
the nucleotides (nts) which are denoted using the symbols A, T, C and G.

DNA coding is a novel solution for the long term storage of digital data which
is highly promising, yet extremely challenging. The main goal of this emerging
field of study is the encoding of any digital data into a quaternary
representation using the four different DNA nucleotides A, T, C, and G. Once a
quaternary encoded strand is created it can be written into a DNA strand using
a biological process of DNA synthesis which allows the creation of synthetic
DNA strands (oligos) which will have the same content as the encoded sequences
of digital data. The DNA oligos can then be safely stored into some special
capsules that protect the DNA from any contacts with water and oxygen and can
guarantee lossless storage for hundreds of years. The stored DNA content can
be read from the stored oligos using the biological process of DNA sequencing.
While fundamental for DNA data storage, the two biological procedures of DNA
synthesis and sequencing impose some difficulties to the encoding of digital
data.To begin with, DNA synthesis is an expensive process and costs several
dollars per synthesized oligo. Therefore, to reduce this cost, the input data
should be efficiently compressed during encoding. Then, sequencing is prone to
errors and requires respecting several constraints in the encoding for
reducing the probability of noise during decoding. More precisely, the
encoding must respect the following rules:

  * •

Rule of balanced G,C content: The encoded strand should not contain a content
of C’s and G’s which is higher than the content of A’s and T’s

  * •

Rule of homopolymers: There should be no repetitions of the same nucleotide
more than 3 consecutive times.

Figure 1: Fixed-length DNA coding workflow introduced in our previous works

Even though there have been multiple encoding methods introduced by the state
of the art ([1],[2],[3],[4]) which respect the above restrictions, none of the
proposed methods provided a simple fixed-length code construction algorithm
which would allow implementing a closed-loop encoding solution for controlling
the compression and thus the corresponding synthesis cost. Most of the
existing works in bibliography have been instead transcoding a JPEG encoded
binary stream ([5],[6],[7]). In our work in [8], we proposed such an
algorithm, which we have named as PAIRCODE, and evaluated its performance by
including it in an end-to-end encoding/decoding workflow which used a source-
allocation to optimize the compression performed using a DWT and a Uniform
Scalar Quantizer (SQ). In [9], we have enhanced the performance of the above
workflow by replacing the SQ with a Vector Quantizer (VQ). The proposed work-
flow performed a fixed-length encoding. In this work we propose a novel
variable-length encoder for the storage of digital images into DNA which is
inspired by the binary JPEG protocol and is adapted to the quaternary nature
of DNA and the needs of DNA data storage. To facilitate understanding, in
section II we will briefly remind our previous contributions. In section III
we present the new variable-length encoding solution and in IV, we provide the
results on the preformance of the proposed algorithm. More precisely, in
section IV-A we present the comparison of the different encoding solutions in
terms of compression efficiency while in section IV-B we test the robustness
of the different methods to sequencing noise. Finally, section V concludes
this work.

##  II Fixed-length encoding using PAIRCODE

In [8], we have introduced the PAIRCODE algorithm for the encoding of digital
data into DNA. This code-construction method is fixed-length and in contrast
to most of the methods proposed by the state of the art, it can be applied to
any type of input data without being restricted to binary inputs.
Consequently, it can be easily embedded to any desired encoding workflow while
being adapted to the needs of DNA data storage. The PAIRCODE algorithm works
according to the following principles.

The design of the constrained quaternary code $\mathcal{C}^{*}$ is based on
the construction of DNA codewords using mainly pair-elements from the
following dictionary:

$\mathcal{C}_{1}=\\{AT,AC,AG,TA,TC,TG,CA,CT,GA,GT\\}$

The concatenation of elements selected from the above dictionary guarantees
that the encoding will not contain any homopolymers or a GC-percentage which
is higher than the AT-percentage. As the selection of elements from
$\mathcal{C}_{1}$ results in the creation of codewords of an even length, we
also allow the creation of odd length codewords by choosing elements from
$\mathcal{C}_{1}$ adding one last element from $\mathcal{C}_{2}=\\{A,T,C,G\\}$
at the end of each codeword. The encoding workflow to which the above
algorithm has been included is depicted in figure 1 and works according to the
following steps.

The input image is decomposed into different subbands using a DWT. Each
subband is independently quantized using a selected quantizer ($Q$). The
quantization is optimized thanks to a source allocation algorithm which aims
in finding the quantization parameters that minimize the distortion of each
subband for a given target compression rate. The quantized subbands are
encoded using the proposed PAIRCODE algorithm to encode each quantized
coefficient. The encoded strands are cut into smaller chunks (oligos) of
length 200-300 nts and formatted using any necessary headers to denote their
order in the long encoded sequence. This formatting process is necessary to
ensure an error-free DNA synthesis as the synthesis error increases
exponentially for longer DNA strands. The oligos are synthesized in DNA and
stored. When one wants to read back the oligos (decoding step), the
synthesized data is amplified using Polymerase Chain Reaction (PCR) which is
an enzymatic process that creates multiple copies of DNA strands, adding the
redundancy needed for error correction. Then, the process of sequencing will
provide multiple copies, which might contain errors, of each synthesized and
amplified oligo. Finally, the consensus sequences are estimated from the noisy
copies, which are used to decode and reconstruct the stored data by following
the inverse process of the one used in the encoding.

Figure 2: Workflow of the modified JPEG workflow (JPEG-DNA) to suit the needs
of DNA coding

In [8] we introduced the above workflow for fixed-length encoding and have
proposed using a scalar quantizer for the compression. In our latest work in
[9], we have improved the workflow’s efficiency by replacing scalar quantizer
with a Vector Quantizer (VQ). The obtained results were much more promising as
VQ allowed capturing information regarding the distribution of the image but
this solution required knowledge of the codebook in the decoder. Consequently,
in this new study we propose a new variable-length encoder which is optimizing
the compression similarly to the classical JPEG standard. More precisely, in
this work we extend the JPEG algorithm to a constrained quaternary
representation which is using a combination of our proposed PAIRCODE algorithm
and the encoding algorithm proposed by Goldman et al. [7].

##  III JPEG-DNA: A modified JPEG coder for DNA coding

Inspired by the main workflow of the classical JPEG standard, in this work we
propose JPEG-DNA, a modified version of the JPEG algorithm for the encoding of
an image into a constrained quaternary representation of A, T, C and G.
Classical JPEG provides an optimal encoding expressed into a binary
representation by using two main coding techniques. The first technique is the
Huffman coding used to encode the run/category of the AC indices produced by a
Discrete Cosine Transform, as well as the category of the DC indices. Huffman
codes take into consideration the frequency of each run/category AC element or
category DC element throughout the full image and assigns binary words to the
different values while ensuring that each binary representation is not a
prefix of another. The main asset of Huffman coding is that the algorithm
assigns the shortest words to the most frequent elements so to enhance the
performance of the encoding in terms of compression. Then, the second method
used in JPEG is a simple binary coding of the values of AC and DC indices.
This encoding is simply transforming each value into its binary representation
using a number of bits which is predefined by the category field that
precedes. It is therefore clear, that to modify the existing JPEG algorithm so
to provide a quaternary representation one would need to replace those two
binary encodings by some appropriate quaternary ones while respecting the
encoding constraints of DNA coding.

In the works of Goldman et al. in [7], the authors presented an interesting
algorithm for encoding a sequence of symbols to a constrained DNA sequence.
One of the main assets of this algorithm compared to other state of the art
methods is that similarly to our proposed constrained codebook it can be
applied to any type of input without being restricted to binary inputs. The
algorithm proposed by Goldman encodes the input data using a ternary Huffman
into a stream of the trits 0, 1 and 2. Then, trit is replaced with one of the
nucleotides, excuding the one which was previously used, this way ensuring
that no homopolymers are generated. Hence, since the above algorithm is using
Huffman codes it seems to be an interesting candidate to replace the binary
Huffman encoding of the classical JPEG standard.

Range |  | Category
---
(#nt used for encoding)
0 | 0
-5, $\ldots$ , -1,1, $\ldots$ , 5 | 2
-25,$\ldots$ , -6,6, $\ldots$ , 25 | 3
-75,$\ldots$ , -26,26, $\ldots$ , 75 | 4
-275,$\ldots$ , -76,76, $\ldots$ , 275 | 5
-775,$\ldots$ , -276,276, $\ldots$ , 775 | 6
-2775,$\ldots$ , -776,776, $\ldots$ , 2775 | 7
-7775,$\ldots$ , -2776,2776, $\ldots$ , 7775 | 8

TABLE I: Category range for encoding values using DNA. Category 1 is omitted
due to the biological constraints imposed by DNA sequencing.

Figure 3: Comparison of the different proposed encoding solutions. The methods
compared are the following: nucleotide allocation using SQ and PAIRCODE for
the encoding (red), nucleotide allocation using VQ and PAIRCODE for the
encoding (blue), JPEG transcoding (magenta) and JPEG with the quaternary code
included in the optimization (black).

nt allocation using SQ 1 deletion in LL subband

nt allocation using VQ 1 deletion in LL subband

JPEG-DNA 1 deletion

transcoding 1 deletion

Figure 4: The impact of one deletion error on a 512x512 pixel image of a cat
for the different encoding solutions. The original images have been compressed
to obtain the same PSNR value of 38.5 dB.

Then, for replacing the binary encoding of JPEG for the non-zero values of the
AC and DC indices, we propose using our PAIRCODE algorithm which works
similarly to the classical fixed-length binary encoding and provides a
quaternary representation while respecting the sequencing constraints. The use
of this code will change the range of the categories which will now determine
the number of nucleotides rather than the number of bits that will be used for
the encoding of an element. Since in our encoding a representation of 1nt per
element is not permitted, category 1 is omitted from the list of possible
categories as shown in table I. In other words, in the proposed variable-
length algorithm we have used the main workflow of JPEG by replacing the
binary Variable Length Coding (VLC), which uses binary Huffman and classical
binary encoding, with a quaternary VLC algorithm that uses the algorithm
proposed in Goldman et al. and our constrained code (PAIRCODE). More
precisely, the run/category of AC indices and the category of DC indices are
encoded using a ternary Huffman to produce a sequence of trits, each of which
is then encoded to one nucleotide by avoiding the symbol which had been used
for encoding the previous position. The values of AC and DC indices are then
encoded to some codeword of length $l$ that belongs to a code which has been
generated using PAIRCODE. The length $l$ depends on the category to which the
value belongs (table I). The modified workflow is presented in figure 2. In
the following section we provide experimental results on the performance of
this modified JPEG code compared to the fixed length encoding which has been
proposed in our previous works. We also provide the results of the transcoding
method which encodes the binary output of a classical JPEG using a quaternary
fixed length coding for encoding each byte of the JPEG binary stream.

##  IV Results

###  IV-A Comparison of the different encoding solutions

In this section, we compare all the encoding methods proposed in our studies.
Namely, we will compare the two fixed-length encoding solutions using a
Uniform Scalar Quantizer, as proposed in [8], and a VQ as proposed in [9], to
our proposed JPEG-DNA solution and the simpler transcoding method. For the
comparison we built the curve of PSNR in function of the coding potential in
bits/nt and the result is given in figure 3. As observed, the fixed length
encoding with the Scalar Quantizer has the less efficient performance. This
result is justified by the fact that, as expected, fixed length solutions are
less performant than variable length encodings and in the case of a Scalar
quantization the encoder is not taking into consideration the distribution of
the source and thus the compression is less adapted to the characteristics of
the input image. However, this has been only our very first attempt to build a
simple fixed-length encoder which allows controlling the compression rate to
test the performance of our proposed PAIRCODE algorithm.

Interestingly enough, the fixed-length solution which is using a VQ for the
quantization, provided results which are comparable to the ones of the
variable-length solutions. This improvement in the performance is explained by
the fact that in the case of a VQ the encoder uses some knowledge of the
characteristics of the input. This information stems from the use of a well-
selected training set of images, with similar characteristics to the input
image, for the creation of a good codebook of quantization vectors.

We also observe that among the variable length solutions, simple transcoding
shows the best results. In other words, even if the ”closed-loop” solution of
inserting PAIRCODE into the code of JPEG to allow controlling the compression
was expected to perform better, the result is different than predicted. The
difference in the performance between the two variable length encoding methods
is explained by the constraints imposed on the quaternary encoding. More
specifically, in the proposed ”closed-loop” solution the category 1 that is
using 1 nt to encode a value is omitted in order to avoid the creation of
homopolymers. However, in most cases the values of category 1 are the most
frequent ones, and thus in the transcoding case those values will be encoded
by 1 bit while in the quaternary case they are encoded by 2 nts. This
explanation becomes even more apparent when checking how the difference in
both cases’ performance evolves with the increase of the encoding rate. The
more the encoding rate increases, the more frequent values which are found
around zero will be quantized to category 1 and thus transcoding will take the
lead in terms of performance. Nevertheless, since this has been only a first
proposal for implementing an efficient variable-length quaternary encoding for
DNA data storage, the proposed algorithm can be further improved to deal with
this issue and provide better results.

###  IV-B Robustness of the different encoding solutions

Even though the above experiment is testing the strength of the encoding
scenarios in terms of compression quality, one must not neglect the main
obstacle of DNA coding which is the error-prone DNA sequencing. It is clear,
that even though a fixed length encoding might be less efficient in
compression, it is more robust to sequencing noise. This is due to the fact
that in the case of an error during sequencing, only a part of the decoding
will be affected. To facilitate understanding, let’s take the following
example. Assuming the case of a deletion error, the full structure of an oligo
is affected by shifting all the nucleotides following the deleted-one, by one
position. However, since the encoding is fixed-length, the decoding of one
oligo does not depend on the decoded information of the previous oligos. Thus,
even is one oligo is lost, the following oligo can be correctly decoded. on
the other hand, in a variable-length encoding, a deletion error in some oligo
will also affect the rest of the decoding and the structure of the image can
be lost.

To prove this claim we have tested the decoding of an image in the presence of
one single deletion at a random position for the cases of a simple fixed-
length encoding using Vector Quantization and the two variable length
solutions of transcoding and modified JPEG for DNA. The impact of such an
error in the visual quality of the decoded image is presented in figure 4. As
observed, the impact of one deletion error in the fixed-length encoding using
VQ affects less the visual quality of the input image and causes the loss of a
single vector. However, in the case of a variable length encoding, one
deletion will completely change the image reconstruction causing a higher
visual distortion. More precisely, in the case of transcoding, the error has a
much worse impact on the decoding of the image.

To give an explanation to this fact, let’s consider a pool of oligos which
have been selected as the most representative ones after computing the
consensus sequences. Then let’s assume that all the selected oligos are
correct except for one, which has suffered a deletion error. In the case of
the JPEG-DNA, one deletion will cost a shift in all the nucleotides that
follow the deletion. Therefore, the total impact on the long reconstructed
strand will be a shift of all nucleotides following the deleted nucleotide by
one position to the left. The same type of error in the case of transcoding,
one single deletion will create a shift on the DNA strand after the deleted
nucleotide that will cause a wrong decoding of all the bytes that follow the
deletion. This creates much more distortion that leads in losing big part of
the input image. It is obvious that, as predicted, the fixed length encoding
solutions are much more robust to noise while in the case of variable-length
one error can result in losing the structure of the image. It is therefore
clear that in DNA coding the selection of the best encoding solution does not
only rely upon the performance, but highly depends on the robustness to
sequencing error.

##  V Conclusions

In this work, we have proposed JPEG-DNA, a DNA image coding solution based on
the classical JPEG standard. This solution introduces in the standard codec a
variable-length DNA closed-loop coding. Even though the comparison of the
different methods presented shows a higher performance when transcoding the
binary output of a classical JPEG, the fixed length encoding solutions are
much more robust to noise as in the case of variable-length one error can
result in losing the structure of the image. Furthermore, among the variable-
length solutions, JPEG-DNA is more robust than transcoding. It is therefore
clear that in DNA coding the selection of the best encoding solution does not
only rely upon the performance, but highly depends on the robustness to
errors.

## References

  * [1] Robert N Grass, Reinhard Heckel, Michela Puddu, Daniela Paunescu, and Wendelin J Stark,  “Robust chemical preservation of digital information on DNA in silica with error-correcting codes,”  Angewandte Chemie International Edition, vol. 54, no. 8, pp. 2552–2555, 2015.
  * [2] Meinolf Blawat, Klaus Gaedke, Ingo Huetter, Xiao-Ming Chen, Brian Turczyk, Samuel Inverso, Benjamin W Pruitt, and George M Church,  “Forward error correction for DNA data storage,”  Procedia Computer Science, vol. 80, pp. 1011–1022, 2016.
  * [3] James Bornholt, Randolph Lopez, Douglas M Carmean, Luis Ceze, Georg Seelig, and Karin Strauss,  “A DNA-based archival storage system,”  ACM SIGOPS Operating Systems Review, vol. 50, no. 2, pp. 637–649, 2016.
  * [4] Yaniv Erlich and Dina Zielinski,  “Capacity-approaching DNA storage,”  bioRxiv, p. 074237, 2016.
  * [5] SM Hossein Tabatabaei Yazdi, Yongbo Yuan, Jian Ma, Huimin Zhao, and Olgica Milenkovic,  “A rewritable, random-access DNA-based storage system,”  Scientific reports, vol. 5, pp. 14138, 2015.
  * [6] SM Hossein Tabatabaei Yazdi, Ryan Gabrys, and Olgica Milenkovic,  “Portable and error-free dna-based data storage,”  Scientific reports, vol. 7, no. 1, pp. 1–6, 2017.
  * [7] Nick Goldman, Paul Bertone, Siyuan Chen, Christophe Dessimoz, Emily M LeProust, Botond Sipos, and Ewan Birney,  “Towards practical, high-capacity, low-maintenance information storage in synthesized DNA,”  Nature, vol. 494, no. 7435, pp. 77, 2013.
  * [8] Melpomeni Dimopoulou, Marc Antonini, Pascal Barbry, and Raja Appuswamy,  “A biologically constrained encoding solution for long-term storage of images onto synthetic DNA,”  in EUSIPCO 2019, Galicia, Spain, Sept. 2019.
  * [9] Melpomeni Dimopoulou and Marc Antonini,  “Image storage in DNA using Vector Quantization,”  in EUSIPCO 2020, Amsterdam, Netherlands, Jan. 2021.


#  Fermat quotients and the Ankeny-Artin-Chowla conjecture

Nic Fellini
Queen’s University
<EMAIL_ADDRESS>M. Ram Murty111Research partially supported by an NSERC
Discovery grant
Queen’s University
<EMAIL_ADDRESS>
###### Abstract

In this article, we present streamlined proofs of results of Ankeny, Artin,
and Chowla concerning the fundamental unit of the real quadratic field
$\mathbb{Q}(\sqrt{p})$ for primes $p\equiv 1\left(\mathrm{mod}\ 4\right)$
while providing a generalization of their conjecture. Using our
generalization, we relate Fermat quotients of quadratic non-residues
$\left(\mathrm{mod}\ p\right)$ to sums of harmonic numbers.

##  1 Introduction

In 1951, Ankeny, Artin, and Chowla [1] derived four congruence relations for
the class number of real quadratic fields $\mathbb{Q}(\sqrt{p})$ with $p$ a
prime. In a later paper, [2], they published proofs of only three relations
and perhaps inadvertently omitted the proof of the fourth relation. This gap
was filled in by Carlitz [4] who gave a proof but again omitted to write out
several key steps of the proof. The missing steps involve the use of the
$p$-adic logarithm, a profound idea introduced in [2] and developed later by
Iwasawa [13]. Looking back at the paper of Ankeny, Artin and Chowla, one
cannot fail to see the birth of two fundamental concepts of number theory: one
is the $p$-adic logarithm and the other is the use of the group ring to study
cyclotomic fields, both of which had a transformative influence in the number
theory of the twentieth century.

In this paper, we will amplify this idea giving simplified proofs of the
results in [1] and [2]. At the same time, we extend these results and
investigate a conjecture of Ankeny, Artin, and Chowla explained in the next
section.

##  2 An extension of the Ankeny-Artin-Chowla congruence

Let $p$ be a prime $\equiv 1\left(\mathrm{mod}\ 4\right)$. The fundamental
unit of $\mathbb{Q}(\sqrt{p})$ can be written as

$\varepsilon=\frac{t+u\sqrt{p}}{2}$ (1)

for positive integers $t$ and $u$. Ankeny, Artin and Chowla [1] stated the
result

$\frac{2hu}{t}\equiv\frac{A+B}{p}\left(\mathrm{mod}\ p\right)$ (2)

where $h$ is the class number of $\mathbb{Q}(\sqrt{p})$, $A$ is the product of
the quadratic residues $\left(\mathrm{mod}\ p\right)$ lying in $[1,p]$ and $B$
is the product of the quadratic non-residues $\left(\mathrm{mod}\ p\right)$
lying in $[1,p]$. This was one of the four results stated in [1] and three of
these four results were proved in [2]. Carlitz [4] noted this gap and provided
a proof but was vague in several key steps. The essential ingredient of the
$p$-adic logarithm needed to derive (2) is not clearly enunciated in [4] or
[2]. We will fill this gap in our discussion below. We will also use this
occasion to give streamlined proofs of the results in [1] and [2].

In their paper, Ankeny, Artin and Chowla conjecture that for primes $p\equiv
1\pmod{4}$, we always have $p\nmid u$. They verified their conjecture when
$p\equiv 5\pmod{8}$ and $p<2000$. Van der Poorten, te Riele and Williams [11]
[12] verified the conjecture for all primes $p<2\cdot 10^{11}$. The interest
in this conjecture lies in the following observation. In 1960, Ankeny and
Chowla [3] proved that $h<p$. For any given prime $p$, the quantities $A$, $B$
and $\varepsilon$ are easily computed (using the continued fraction of
$\sqrt{p}$ in the case of $\varepsilon$) and so, (2) provides a congruence for
$h\pmod{p}$. But since $h<p$, the reduced residue gives the exact value of $h$
provided $u$ is not divisible by $p$.

We briefly address remarks made by Ankeny and Chowla [3] regarding $h<p$. In
their paper, they wrote that this estimate is not well-known and cite a
comment of Carlitz [4] to this effect. They then give a proof of the stronger
estimate $h=O(\sqrt{p}).$ In a postscript to their paper, they provide another
proof of the weaker estimate $h=O(p^{1/2+\varepsilon})$ due to Mordell which
uses the theory of reduced binary quadratic forms. The proof given in [3]
employs Dirichlet’s class number formula though the authors never say so. In
fact, the formula on top of page 146 is pulled out of the “hat of Dirichlet.”

It is relatively painless to give a proof that $h=O(\sqrt{p})$ using
Dirichlet’s formula in the form

$\frac{2h\log\varepsilon}{\sqrt{|d_{K}|}}=\sum_{n=1}^{\infty}\frac{\chi(n)}{n},$
(3)

where $\chi(n)=(d_{K}/n)$ is the Kronecker symbol, $d_{K}$ is the discriminant
of $K={\mathbb{Q}}(\sqrt{p}).$ From (1), we see that $\varepsilon\gg\sqrt{p}$
so that the left hand side of (3) is

$\gg\frac{h\log p}{\sqrt{p}}.$

On the other hand, the right hand side of (3) can be re-written (by partial
summation) as

$\sum_{n=1}^{p-1}\frac{\chi(n)}{n}+\int_{p}^{\infty}\frac{S(x)}{x^{2}}dx,$

where $S(x)=\sum_{n<x}\chi(n)$. As $S(x)=O(p)$, we see that the right hand
side of (3) is bounded by $O(\log p)$ and the claim is now immediate. We
remark that an identical proof shows that the class number $h(D)$ of
${\mathbb{Q}}(\sqrt{D})$ with $D$ a fundamental discriminant is also
$O(\sqrt{|D|})$. We will use this fact in a later section.

A natural question that arises is what result emerges in (2) if we replace $A$
and $B$ by complete sets $\\{a_{s}\\}_{s=1}^{(p-1)/2}$,
$\\{b_{s}\\}_{s=1}^{(p-1)/2}$ of quadratic residues and non-residues
(respectively) but not lying necessarily in $[1,p]$. We will assume that the
$a_{s},b_{s}$ are all positive. This question is easily answered as follows.

Writing

$\displaystyle a_{s}$ $\displaystyle=\langle
a_{s}\rangle+p\left[\frac{a_{s}}{p}\right]$ $\displaystyle b_{s}$
$\displaystyle=\langle b_{s}\rangle+p\left[\frac{b_{s}}{p}\right]$

where $\langle x\rangle$ denotes the reduced residue of $x\left(\mathrm{mod}\
p\right)$. Then,

$\displaystyle A$
$\displaystyle=\prod_{s=1}^{(p-1)/2}\left(a_{s}-p\left[\frac{a_{s}}{p}\right]\right)$
$\displaystyle B$
$\displaystyle=\prod_{s=1}^{(p-1)/2}\left(b_{s}-p\left[\frac{b_{s}}{p}\right]\right).$

We easily see that

$\displaystyle A$ $\displaystyle\equiv
A^{*}-pA^{*}\sum_{s=1}^{(p-1)/2}\left[\frac{a_{s}}{p}\right]\frac{1}{a_{s}}\left(\mathrm{mod}\
p^{2}\right)$ $\displaystyle B$ $\displaystyle\equiv
B^{*}-pB^{*}\sum_{s=1}^{(p-1)/2}\left[\frac{b_{s}}{p}\right]\frac{1}{b_{s}}\left(\mathrm{mod}\
p^{2}\right)$

where

$A^{*}=\prod_{s=1}^{(p-1)/2}a_{s}\,\,\,\,\,\text{ and
}\,\,\,\,\,B^{*}=\prod_{s=1}^{(p-1)/2}b_{s}.$

Thus,

$A+B\equiv
A^{*}+B^{*}-p\left(A^{*}\sum_{s=1}^{(p-1)/2}\left[\frac{a_{s}}{p}\right]\frac{1}{a_{s}}+B^{*}\sum_{s=1}^{(p-1)/2}\left[\frac{b_{s}}{p}\right]\frac{1}{b_{s}}\right)\left(\mathrm{mod}\
p^{2}\right).$

Therefore,

$\frac{A+B}{p}\equiv\frac{A^{*}+B^{*}}{p}-\left(A^{*}\sum_{s=1}^{(p-1)/2}\left[\frac{a_{s}}{p}\right]\frac{1}{a_{s}}+B^{*}\sum_{s=1}^{(p-1)/2}\left[\frac{b_{s}}{p}\right]\frac{1}{b_{s}}\right)\left(\mathrm{mod}\
p\right).$

This leads to the following variant of (2).

######  Theorem 2.1.

Let $p\equiv 1\left(\mathrm{mod}\ 4\right)$ be a prime and
$\\{a_{s}\\},\\{b_{s}\\}$ be positive numbers representing a complete set of
quadratic residues and non-residues $\left(\mathrm{mod}\ p\right)$
respectively. Let $A^{*}$ and $B^{*}$ be the product of the $a_{s}$ and
$b_{s}$ respectively. If $\varepsilon=\frac{1}{2}(t+u\sqrt{p})$ is the
fundamental unit of $\mathbb{Q}(\sqrt{p})$, then

$\frac{A^{*}+B^{*}}{p}\equiv\frac{2hu}{t}+\left(A^{*}\sum_{s=1}^{(p-1)/2}\left[\frac{a_{s}}{p}\right]\frac{1}{a_{s}}+B^{*}\sum_{s=1}^{(p-1)/2}\left[\frac{b_{s}}{p}\right]\frac{1}{b_{s}}\right)\left(\mathrm{mod}\
p\right).$

######  Remark.

If $1\leq a_{s},b_{s}\leq p$, then the two sums in the congruence above vanish
identically and we retrieve the Ankeny, Artin, and Chowla congruence (2).

##  3 Relation to Fermat quotients and harmonic numbers

Let $R$ be a complete set of quadratic residues $\left(\mathrm{mod}\ p\right)$
all lying in $[1,p-1]$ and $N$ a complete set of quadratic non-residues
$\left(\mathrm{mod}\ p\right)$ all lying in $[1,p-1]$. Then $A^{*}=A$ and
$A\equiv-1\left(\mathrm{mod}\ p\right)$. Moreover, $B^{*}=B$ and $B\equiv
1\left(\mathrm{mod}\ p\right)$. Now we fix a quadratic non-residue
$m\left(\mathrm{mod}\ p\right)$ and define the two sequences

$b_{r}=mr\,\,\,(r\in R)\,\,\,\,\,\text{ and }\,\,\,\,\,a_{n}=mn\,\,\,(n\in
N).$

In this set-up, Theorem 2.1 reads as

$\frac{A+B^{*}}{p}\equiv\frac{2hu}{t}+B^{*}\sum_{r\in
R}\left[\frac{mr}{p}\right]\frac{1}{mr}\left(\mathrm{mod}\ p\right)$

and

$\frac{A^{*}+B}{p}\equiv\frac{2hu}{t}+A^{*}\sum_{n\in
N}\left[\frac{mn}{p}\right]\frac{1}{mn}\left(\mathrm{mod}\ p\right)$

respectively. Observing that $B^{*}=m^{(p-1)/2}A$ and $A^{*}=m^{(p-1)/2}B$
respectively, and that $m^{(p-1)/2}\equiv-1\left(\mathrm{mod}\ p\right)$, we
deduce

$\displaystyle A\left(\frac{m^{\frac{p-1}{2}}+1}{p}\right)$
$\displaystyle\equiv\frac{2hu}{t}-A\sum_{r\in
R}\left[\frac{mr}{p}\right]\frac{1}{mr}\left(\mathrm{mod}\ p\right)$ (4)
$\displaystyle B\left(\frac{m^{\frac{p-1}{2}}+1}{p}\right)$
$\displaystyle\equiv\frac{2hu}{t}-B\sum_{n\in
N}\left[\frac{mn}{p}\right]\frac{1}{mn}\left(\mathrm{mod}\ p\right)$ (5)

This then leads to a refinement of [1]:

######  Theorem 3.1.

Suppose $p$ is a prime $\equiv 1\left(\mathrm{mod}\ 4\right)$ and let $R$ a
complete set of quadratic residues lying in $[1,p-1]$, $N$ a complete set of
quadratic non-residues lying in $[1,p-1]$,

$\varepsilon=\frac{t+u\sqrt{p}}{2}$

be the fundamental unit of $\mathbb{Q}(\sqrt{p})$, and $h$ the class number of
$\mathbb{Q}(\sqrt{p})$. Then for any quadratic non-reside
$m\left(\mathrm{mod}\ p\right)$,

$\displaystyle\frac{m^{p-1}-1}{p}$
$\displaystyle\equiv\frac{4hu}{t}+2\sum_{r\in
R}\left[\frac{mr}{p}\right]\frac{1}{mr}\left(\mathrm{mod}\ p\right)$ (6)
$\displaystyle\frac{m^{p-1}-1}{p}$
$\displaystyle\equiv-\frac{4hu}{t}+2\sum_{n\in
N}\left[\frac{mn}{p}\right]\frac{1}{mn}\left(\mathrm{mod}\ p\right)$ (7)

###### Proof.

By the above discussion, the theorem follows at once by noting that
$A\equiv-1\left(\mathrm{mod}\ p\right)$ and $B\equiv 1\left(\mathrm{mod}\
p\right)$ and by multiplying equations (4) and (5) by
$m^{(p-1)/2}-1\equiv-2\left(\mathrm{mod}\ p\right)$. ∎

######  Definition.

For $p$ a prime number, the base $a$ Fermat quotient is the integer defined as

$F(a)=\frac{a^{p-1}-1}{p}.$

Adding the two congruences in Theorem 3.1 we deduce:

######  Corollary 3.2.

Suppose $p\equiv 1\left(\mathrm{mod}\ 4\right)$ and $m$ is a quadratic non-
residue $\left(\mathrm{mod}\ p\right)$. Then,

$mF(m)\equiv 2\sum_{k=1}^{p-1}\left[\frac{mk}{p}\right]\frac{1}{k}$

where $F(m)$ is the Fermat quotient.

######  Remark.

We observe that this congruence relation for the Fermat quotient is
unconditional of the Ankeny-Artin-Chowla conjecture. If $p\mid u$, then the
terms involving the class number in Theorem 3.1 vanish. If $p\nmid u$, these
same two terms cancel when added.

######  Definition.

The $k$-th harmonic number $H_{k}$ is defined as

$H_{k}=\sum_{j=1}^{k}\frac{1}{j}$

where we understand that $H_{0}=0$.

######  Lemma 3.3.

For any odd prime $p$, $H_{p-1}\equiv 0\left(\mathrm{mod}\ p\right)$.

###### Proof.

This is a simple matter of pairing up additive inverses. As $k$ runs through
$\\{1,\ldots,\frac{p-1}{2}\\}$, $p-k$ will run through
$\\{p-1,\ldots,\frac{p+1}{2}\\}$. Hence,

$H_{p-1}=\sum_{k=1}^{p-1}\frac{1}{k}\equiv\sum_{k=1}^{\frac{p-1}{2}}\left(\frac{1}{k}+\frac{1}{p-k}\right)\equiv\sum_{k=1}^{\frac{p-1}{2}}\left(\frac{1}{k}-\frac{1}{k}\right)\equiv
0\left(\mathrm{mod}\ p\right).$

∎

An immediate corollary of Lemma 3.3 is the following:

######  Corollary 3.4.

Suppose $p$ is prime and $a<b$ are positive integers such that $a+b=p-1$, then

$H_{a}\equiv H_{b}\left(\mathrm{mod}\ p\right).$

###### Proof.

By Lemma 3.3, we have

$0\equiv
H_{p-1}\equiv\sum_{j=1}^{a}\frac{1}{j}+\sum_{j=a+1}^{p-1}\frac{1}{j}\left(\mathrm{mod}\
p\right).$

By assumption, $a+1=p-b$ and hence

$H_{a}\equiv-\sum_{j=p-b}^{p-1}\frac{1}{j}\left(\mathrm{mod}\ p\right).$

Making the change of variables, $j\to p-j$ we have,

$H_{a}\equiv\sum_{j=1}^{b}\frac{1}{j}\equiv H_{b}\left(\mathrm{mod}\
p\right).$

∎

Setting $x_{k}=H_{k-1}$, Corollary 3.2 reads as

$mF(m)\equiv\sum_{k=1}^{p-1}\left[\frac{mk}{p}\right](x_{k+1}-x_{k})\left(\mathrm{mod}\
p\right).$

Using summation by parts this becomes

$mF(m)\equiv
x_{p}\left[\frac{m(p-1)}{p}\right]-\sum_{k=2}^{p-1}x_{k}\left(\left[\frac{mk}{p}\right]-\left[\frac{m(k-1)}{p}\right]\right)\left(\mathrm{mod}\
p\right).$

The first term on the right hand side vanishes by Lemma 3.3. Now in the
summand, we simplify the difference of the floor functions using the following
lemma:

######  Lemma 3.5.

Suppose $p$ is prime and that $M$ is any positive coset representative of a
positive reduced residue $m\left(\mathrm{mod}\ p\right)$. Then,

$\left[\frac{Mk}{p}\right]-\left[\frac{M(k-1)}{p}\right]=\left[\frac{M}{p}\right]+\left[\frac{mk}{p}\right]-\left[\frac{m(k-1)}{p}\right]$

for all $1\leq k\leq p-1$. In particular, if $M=m$ then

$\left[\frac{mk}{p}\right]-\left[\frac{m(k-1)}{p}\right]=\begin{cases}1&\text{if
}k=\left[\frac{p\ell}{m}\right]+1\text{ for some $\ell\in[0,m-1]$}\\\
0&\text{otherwise}.\end{cases}$

###### Proof.

Write $M=m+p\left[\frac{M}{p}\right]$. Then,

$\left[\frac{Mk}{p}\right]-\left[\frac{M(k-1)}{p}\right]=\left[\frac{mk}{p}+k\left[\frac{M}{p}\right]\right]-\left[\frac{m(k-1)}{p}+(k-1)\left[\frac{M}{p}\right]\right].$

As $\left[x+n\right]=\left[x\right]+n$ for any positive integer $n$, we deduce
the first part of the statement.

For the second statement, we note that
$\left[\frac{mk}{p}\right]-\left[\frac{m(k-1)}{p}\right]\neq 0$ if and only if
there exists some positive integer $\ell\leq m-1$ such that

$\frac{m(k-1)}{p}<\ell\leq\frac{mk}{p}.$

Rearranging this inequality, we have that

$k-1<\frac{p\ell}{m}\leq k$

and hence $k-1=\left[\frac{p\ell}{m}\right]$. For these values of $k$, we seek
to simplify:

$\left[\frac{m}{p}\left(\left[\frac{p\ell}{m}\right]+1\right)\right]-\left[\frac{m}{p}\left[\frac{p\ell}{m}\right]\right].$

Writing $p\ell=\theta+m\left[\frac{p\ell}{m}\right]$ for $0<\theta<m$ we
deduce that

$\frac{m}{p}\left[\frac{p\ell}{m}\right]=\ell-\frac{\theta}{p}.$

Using this relation we have:

$\left[\frac{m}{p}\left(\left[\frac{p\ell}{m}\right]+1\right)\right]-\left[\frac{m}{p}\left[\frac{p\ell}{m}\right]\right]=\left[\ell-\frac{\theta}{p}+\frac{m}{p}\right]-\left[\ell-\frac{\theta}{p}\right]=\left[\frac{m-\theta}{p}\right]-\left[-\frac{\theta}{p}\right]$

Since $0<\theta<m$, the first floor function on the right is zero as
$0<m-\theta<p$. The second term is $-1$ as $-1<-\theta/p<0$. The result then
follows. ∎

######  Lemma 3.6.

Fix $p$ and some $q<p$. Then for all $1\leq k\leq q-1$ we have

$\left[\frac{pk}{q}\right]+\left[\frac{p(q-k)}{q}\right]=p-1.$

###### Proof.

Suppose $\left[\frac{pk}{q}\right]=\ell$. Then we have that

$\left[\frac{p(q-k)}{q}\right]=p+\left[\frac{-pk}{q}\right]$

and since $\left[\frac{pk}{q}\right]=\ell$ we deduce that
$\left[\frac{-pk}{q}\right]=-\ell-1$. Hence,

$\left[\frac{pk}{q}\right]+\left[\frac{p(q-k)}{q}\right]=\ell+(p-\ell-1)=p-1.$

∎

Therefore, by Lemma 3.5, and partial summation we deduce:

######  Theorem 3.7.

If $p\equiv 1\left(\mathrm{mod}\ 4\right)$ is a prime and $M$ is any positive
coset representative of a quadratic non-residue $m\left(\mathrm{mod}\
p\right)$, then

$-MF(M)\equiv\left[\frac{M}{p}\right]+\sum_{j=1}^{m-1}H_{\left[\frac{pj}{m}\right]}.$

######  Remark.

One can shorten the sum on the right in Theorem 3.7 by applying Corollary 3.4
and Lemma 3.6. The length of the resulting sum depends only on the parity of
$m$.

######  Remark.

Note that if $p\equiv 5\left(\mathrm{mod}\ 8\right)$, so that $2$ is a
quadratic non-residue, Theorem 3.7 yields

$-2F(2)\equiv H_{\left[\frac{p}{2}\right]}\left(\mathrm{mod}\ p\right)$

as the sum contains only a single term. Moreover, as $p$ is odd,
$\left[\frac{p}{2}\right]=\frac{p-1}{2}$. In effect, we recover Eisenstein’s
congruence

$-2F(2)\equiv H_{\frac{p-1}{2}}\left(\mathrm{mod}\ p\right)$

for all primes $p\equiv 5\left(\mathrm{mod}\ 8\right)$ [5]. In fact, we get a
slight generalization of this result. Suppose $1<m<p$ is an odd quadratic non-
residue with $p\equiv 1\left(\mathrm{mod}\ m\right)$. From the previous
remark, Theorem 3.7, and the fact that
$\left[\frac{pj}{m}\right]=\frac{(p-1)j}{m}$, we deduce that

$-mF(m)\equiv
2\sum_{j=1}^{(m-1)/2}H_{\left(\frac{p-1}{m}\right)j}\left(\mathrm{mod}\
p\right).$

######  Remark.

The Fermat quotient $F(a)=\frac{a^{p-1}-1}{p}$ satisfies the “logarithmic”
functional equation

$F(ab)=F(a)+F(b)\left(\mathrm{mod}\ p\right)$

for $a$ and $b$ coprime to $p$. Indeed, $a^{p-1}=1+pF(a)$ so that

$\displaystyle 1+pF(ab)=(ab)^{p-1}=a^{p-1}b^{p-1}=(1+pF(a))(1+pF(b))\equiv
1+p(F(a)+F(b))\left(\mathrm{mod}\ p^{2}\right)$

from which the desired additive congruence is immediate. It is important to
note that the Fermat quotient is a function from
$(\mathbb{Z}/p^{2}\mathbb{Z})^{\times}\to\mathbb{Z}/p\mathbb{Z}$.

######  Theorem 3.8.

Suppose $p\equiv 1\left(\mathrm{mod}\ 4\right)$ is prime. Then the Fermat
quotient of any quadratic residue $\left(\mathrm{mod}\ p\right)$ can be
written as some linear combination of Fermat quotients of quadratic non-
residues $\left(\mathrm{mod}\ p\right)$. Precisely, if $r$ is a quadratic
residue $\left(\mathrm{mod}\ p\right)$ such that
$r\equiv\overline{a}\overline{b}\left(\mathrm{mod}\ p^{2}\right)$ for
quadratic non-residues $\overline{a},\overline{b}\left(\mathrm{mod}\
p^{2}\right)$ such that $\overline{a}\equiv a\left(\mathrm{mod}\ p\right)$ and
$\overline{b}\equiv b\left(\mathrm{mod}\ p\right)$ then,

$-rF(r)\equiv\overline{b}\left[\frac{\overline{a}}{p}\right]+\overline{a}\left[\frac{\overline{b}}{p}\right]+\overline{b}\sum_{j=1}^{a-1}H_{\left[\frac{pj}{a}\right]}+\overline{a}\sum_{k=1}^{b-1}H_{\left[\frac{pk}{b}\right]}\left(\mathrm{mod}\
p\right).$

###### Proof.

This follows from Theorem 3.7 and the logarithmic property of the Fermat
quotients. ∎

##  4 A generalized Ankeny-Artin-Chowla conjecture

In a recent paper [14], Yang and Fu formulated a generalization of the Ankeny-
Artin-Chowla conjecture as follows. Let $D$ be a positive integer which is not
a perfect square. Consider the set of all solutions of the Brahmagupta-Pell
equation

$u^{2}-Dv^{2}=1,$

with $u,v$ natural numbers. Let $(u_{1},v_{1})$ be the least positive integer
solution in this set and denote by $h(4D)$ the class number of primitive
binary quadratic forms of discriminant $4D$. For $D$ odd, they conjecture that

$v_{1}h(4D)\not\equiv 0\pmod{D}.$

We will refer to this as the generalized Ankeny-Artin-Chowla conjecture
(GAAC). Assuming this conjecture, Fu and Yang show that the equation

$x^{y}+y^{x}=z^{2},\quad\min(x,y)>1,\quad(x,y)=1,\quad 2\not|xy,\quad
x,y,z\in{\mathbb{N}}$

has no solution. However, it appears that their conjecture has been made
prematurely. Indeed, in [15] there is a list of six positive squarefree
$D<10^{8}$ such that $v_{1}\equiv 0\left(\mathrm{mod}\ D\right)$. Of the six
counter examples only $D=23\cdot 79,3\cdot 69997$ and $41\cdot 79\cdot 541$
are odd. Each of these three $D$ is a counterexample to GACC.

We will use an elementary sieve argument and basic algebraic number theory to
show that GAAC is true for infinitely many discriminants $D$. We begin with a
very simple set-theoretic sieve inequality:

######  Lemma 4.1 (The simple sieve).

Let $S$ be a finite non-empty set and $I$ a finite indexing set. For each
$i\in I$, we assign a set $A_{i}\subset S$. If $J\subseteq I$, then

$\left|S\setminus\bigcup_{i\in I}A_{i}\right|\geq\left|S\setminus\bigcup_{j\in
J}A_{j}\right|-\sum_{i\in I\setminus J}|A_{i}|.$

An application of the simple sieve plus an elementary counting argument
yields:

######  Lemma 4.2.

The number of $n\in\mathbb{N}$ less than $x$ such that $n^{2}-1$ is square
free is

$|\\{n\leq x:n^{2}-1\text{ is square free}\\}|=Ax+O\left(\frac{x}{\log\log
x}\right)$

where

$A=\prod_{p\leq\log\log x}\left(1-\frac{2}{p^{2}}\right).$

###### Proof.

Let $x$ be sufficiently large. For each prime $p\leq x$ we define:

$A_{p}=\\{n\leq x:p^{2}\mid(n^{2}-1)\\}.$

Then our goal is to estimate

$\left|\\{n\leq x\\}\setminus\bigcup_{p\leq x}A_{p}\right|.$

A straight forward application of the simple sieve gives the lower bound

$\left|\\{n\leq x\\}\setminus\bigcup_{p\leq x}A_{p}\right|\geq\left|\\{n\leq
x\\}\setminus\bigcup_{p\leq z}A_{p}\right|-\sum_{z\leq p\leq x}|A_{p}|.$

where $z$ is some parameter we will choose later.

We make the observation that if $n\in A_{p}$, then $p^{2}\mid(n^{2}-1)$ and in
particular, $p^{2}$ can only divide one of $n-1$ or $n+1$. Therefore, $A_{p}$
will be the number of $n\leq x$ that reduce to $1\left(\mathrm{mod}\
p^{2}\right)$ or $-1\left(\mathrm{mod}\ p^{2}\right)$. From this we deduce
that

$|A_{p}|=\frac{2x}{p^{2}}+O(1).$

Hence,

$\sum_{z\leq p\leq x}|A_{p}|=2x\sum_{z\leq p\leq x}\frac{1}{p^{2}}+O(\pi(x)).$

By the integral test, we see that the sum is bounded above by $1/z$ and
therefore we can bound the sum as

$\sum_{z\leq p\leq x}|A_{p}|\ll\frac{x}{z}+O(\pi(x)).$

Let $P_{z}=\prod_{p\leq z}p$. Then we have that

$|\\{n\leq x:n\notin A_{p}\text{ for any $p\leq z$}\\}|=\sum_{n\leq
x}\sum_{\begin{subarray}{c}d^{2}\mid(n^{2}-1)\\\ d\mid
P_{z}\end{subarray}}\mu(d).$

Switching the order of summation we have

$\sum_{n\leq x}\sum_{\begin{subarray}{c}d^{2}\mid(n^{2}-1)\\\ d\mid
P_{z}\end{subarray}}\mu(d)=\sum_{d\mid
P_{z}}\mu(d)\sum_{\begin{subarray}{c}n\leq x\\\ n^{2}\equiv
1(d^{2})\end{subarray}}1.$

The inner sum is $\frac{x2^{\omega(d)}}{d^{2}}+O(2^{\omega(d)})$. Putting this
into the above equality we have that

$\sum_{n\leq x}\sum_{\begin{subarray}{c}d^{2}\mid(n^{2}-1)\\\ d\mid
P_{z}\end{subarray}}\mu(d)=x\sum_{d\mid
P_{z}}\frac{\mu(d)2^{\omega(d)}}{d^{2}}+O\left(\sum_{d\mid
P_{z}}2^{\omega(d)}\right).$

Noting that $\mu(a)2^{\omega(a)}a^{-2}$ and $2^{\omega(a)}$ are multiplicative
functions, we can write the two sums as products over all the primes less than
$z$, i.e.,

$\sum_{n\leq x}\sum_{\begin{subarray}{c}d^{2}\mid(n^{2}-1)\\\ d\mid
P_{z}\end{subarray}}\mu(d)=x\prod_{p\leq
z}\left(1-\frac{2}{p^{2}}\right)+O\left(\prod_{p\leq z}(1+2)\right).$

The first product converges to a non-zero constant and the product in the
error term can be estimated as $3^{\pi(z)}$. In all, we deduce that

$|\\{n\leq x:n^{2}-1\text{ is square
free}\\}|=Ax+O\left(3^{\pi(z)}\right)+O\left(\frac{x}{z}+\pi(x)\right)$

for some absolute non-zero constant $A$. Choosing $z=\log\log x$, we can bound
the first big-$O$ term by $O((\log x)^{B})$ for some absolute constant $B$ and
the second term by $O(\frac{x}{\log\log x})$. In all,

$|\\{n\leq x:n^{2}-1\text{ is square free}\\}|=Ax+O\left(\frac{x}{\log\log
x}\right)$

∎

For a more detailed analysis of squarefree values of quadratic functions
$f(n)=n^{2}+c$, we refer the reader to section two of [9].

######  Theorem 4.3.

If $D=n^{2}-1$ is squarefree, then $\varepsilon=n+\sqrt{n^{2}-1}$ is the
fundamental unit of ${\mathbb{Q}}(\sqrt{D})$. For such $D$, GAAC is true for
$D$ sufficiently large.

###### Proof.

The fact that $\varepsilon$ is the fundamental unit of
${\mathbb{Q}}(\sqrt{D})$ is an exercise in [6] (see Exercise 8.3.1 on page
115). In the notation of conjecture GAAC, we have $v_{1}=1$. As remarked
earlier, $h(D)=O(\sqrt{|D|})$ and the assertion is now evident by Lemma 4.2.

∎

##  5 The $p$-adic logarithm

One can define the $p$-adic logarithm using the power series

$-\log(1-x)=\sum_{n=1}^{\infty}\frac{x^{n}}{n}.$

Let $v_{p}(n)$ be the largest power of $p$ dividing $n$. We denote by
$|\cdot|_{p}$ the standard $p$-adic metric on $\mathbb{Q}$. Thus if $x=a/b$,
$a,b\in\mathbb{Z}$, $\gcd(a,b)=1$ and $b\neq 0$, then

$|x|_{p}=p^{v_{p}(b)-v_{p}(a)}.$

Since for a given prime $p$, $v_{p}(n)\leq\left[\log n/\log p\right]$, we see
that if $|x|_{p}=\lambda<1$ then

$-\log(1-x)=\sum_{n=1}^{\infty}\frac{x^{n}}{n}$

converges $p$-adically because

$\left|\frac{x^{n}}{n}\right|_{p}\leq\lambda^{n}p^{v_{p}(n)}\to 0$

as $n\to\infty$.

As usual, we denote by $\mathbb{Q}_{p}$ the completion of $\mathbb{Q}$ with
respect to $|\cdot|_{p}$. Given $\mathbb{Q}_{p}$, we take its algebraic
closure $\overline{\mathbb{Q}_{p}}$, we then complete it to obtain the
$p$-adic analogue of the complex numbers denoted by $\mathbb{C}_{p}$. This
field is algebraically closed (see for example, Proposition 5.2 of [13]).

The $p$-adic logarithm defined above for $|x|_{p}<1$ can now be extended to
all of $\mathbb{C}_{p}^{\times}$ such that

$\displaystyle\log xy=\log x+\log y$

and $\log p=0$. To avoid confusion with the usual logarithm, we denote the
$p$-adic logarithm as $\log_{p}$.

To say that $|x|_{p}<1$ is equivalent to saying $v_{p}(x)>0$. If $v_{p}(x)\geq
1/(p-1)$, then in the series

$-\log(1-x)=\sum_{n=1}^{\infty}\frac{x^{n}}{n},$

we see that

$v_{p}\left(\frac{x^{rp^{v}}}{p^{v}}\right)\geq\frac{rp^{v}-v(p-1)}{p-1}=\frac{r((p-1)+1)^{v}-v(p-1)}{p-1}\geq\frac{r{v\choose
2}(p-1)^{2}}{p-1}\geq 1$

if $v\geq 2$, $r\geq 1$ or if $v=1$, $r\geq 2$ or if $v=0$ and $r\geq p-1$.
Thus, we have

$\left|\log(1-x)-\sum_{j=1}^{p}\frac{x^{j}}{j}\right|_{p}<\frac{1}{p}.$

In other words,

$\log(1-x)=-\sum_{j=1}^{p}\frac{x^{j}}{j}\left(\mathrm{mod}\ p\right).$

A simple extension of Wilson’s theorem shows that for $1\leq j\leq p-1$,

$\frac{1}{p}{{p}\choose{j}}\equiv\frac{(-1)^{j-1}}{j}\left(\mathrm{mod}\
p\right).$

Therefore,

$\displaystyle\log(1-x)$
$\displaystyle\equiv\sum_{j=1}^{p-1}\frac{1}{p}{{p}\choose{j}}(-1)^{j}x^{j}+\frac{1}{p}(-1)^{p}x^{p}\left(\mathrm{mod}\
p\right)$
$\displaystyle\equiv\frac{1}{p}\left((1-x)^{p}-1\right)\left(\mathrm{mod}\
p\right).$

This proves:

######  Theorem 5.1 (Ankeny, Artin, Chowla, 1952).

If $v_{p}(x-1)\geq 1/(p-1)$, then

$\log_{p}(x)\equiv\frac{x^{p}-1}{p}\left(\mathrm{mod}\ p\right).$

We can relate this to Fermat quotients

$F(a)=\frac{a^{p-1}-1}{p}$

for $(a,p)=1$ as follows. Writing $a^{p-1}=1+pF(a)$, we have

$\log_{p}(a)=\frac{1}{p-1}\log_{p}a^{p-1}=\frac{1}{p-1}\log_{p}(1+pF(a)).$

On the other hand, we have the $p$-adic series

$\frac{1}{p-1}=-1-p-p^{2}-\cdots$

and

$-\log_{p}(1+x)=-x+\frac{x^{2}}{2}-\cdots$

so that

$\displaystyle\log_{p}(a)$
$\displaystyle=(-1-p-p^{2}-\cdots)\left(pF(a)-\frac{p^{2}F(a)^{2}}{2}+\cdots\right)$
$\displaystyle\equiv-pF(a)\left(\mathrm{mod}\ p^{2}\right).$

Thus, we have:

######  Theorem 5.2.

If $(a,p)=1$, then

$F(a)\equiv-\frac{\log_{p}(a)}{p}\left(\mathrm{mod}\ p\right).$

In particular, if we have sets of integers $\\{a_{s}\\}_{s=1}^{(p-1)/2}$ and
$\\{b_{s}\\}_{s=1}^{(p-1)/2}$ such that

$\prod_{s=1}^{(p-1)/2}a_{s}=-1+p\Omega$

and

$\prod_{s=1}^{(p-1)/2}b_{s}=1+p\Omega^{*},$

then taking $p$-adic logarithms, we derive formula (3.2 ff) of [4]:

$\displaystyle\Omega$
$\displaystyle\equiv\sum_{s=1}^{(p-1)/2}F(a_{s})\left(\mathrm{mod}\ p\right)$
$\displaystyle\Omega^{*}$
$\displaystyle\equiv\sum_{s=1}^{(p-1)/2}F(b_{s})\left(\mathrm{mod}\ p\right)$

######  Remark.

It is this crucial discussion regarding the $p$-adic logarithm that is missing
in [4].

##  6 The group ring, Gauss sums, and congruences

Another important idea of [2] is the use of the group ring attached to a
Galois group $\Gamma$ and how it operates on the field elements. More
precisely, let $K/\mathbb{Q}$ be a finite Galois extension with Galois group
$\Gamma$. The group ring $\mathbb{Q}[\Gamma]$ consists of elements

$\sum_{g\in\Gamma}a_{g}g,\,\,\,\,\,a_{g}\in\mathbb{Q}$

and we define multiplication via

$\left(\sum_{g\in\Gamma}a_{g}g\right)\left(\sum_{h\in\Gamma}b_{h}h\right)=\sum_{z\in\Gamma}\left(\sum_{gh=z}a_{g}b_{h}\right)z.$

If $\Gamma$ is abelian, then $\mathbb{Q}[\Gamma]$ is also abelian.

One can extend the action of $\Gamma$ on the field elements $K$ to the action
of $\mathbb{Q}[\Gamma]$ in the obvious way: for $\alpha\in K$,

$\left(\sum_{g\in\Gamma}a_{g}g\right)(\alpha):=\sum_{g\in\Gamma}a_{g}g(\alpha).$

In the case of the cyclotomic field $\mathbb{Q}(\zeta_{m})$ where $\zeta_{m}$
denotes a primitive $m$-th root of unity, the Galois group $\Gamma$, of
$\mathbb{Q}(\zeta_{m})/\mathbb{Q}$ is
$\Gamma\cong\left(\mathbb{Z}/m\mathbb{Z}\right)^{\times}$, where the
automorphism $\sigma_{a}$ corresponding to the coprime residue class
$a\left(\mathrm{mod}\ m\right)$ is given via

$\sigma_{a}(\zeta_{m})=\zeta_{m}^{a}.$

If $m=p$ is prime, we let $\zeta=\zeta_{p}$ and following [2], we denote by

$G=\sum_{j=1}^{p-1}\left(\frac{j}{p}\right)\sigma_{j}$

the element in the group ring $\mathbb{Q}[(\mathbb{Z}/p\mathbb{Z})^{\times}]$.
Here $\left(\frac{\cdot}{p}\right)$ denotes the Legendre symbol. This element
can be viewed as a “Gauss sum”. Precisely we have:

######  Lemma 6.1.

Let $p\equiv 1\left(\mathrm{mod}\ 4\right)$ be a prime. Suppose $\zeta$ is a
primitive $p$-th root of unity. Then for any $1\leq a\leq p-1$,

$G(\zeta^{a})\equiv\sqrt{p}\left(\frac{a}{p}\right)$

where $\left(\frac{\cdot}{p}\right)$ is the Legendre symbol.

###### Proof.

By definition we have

$G(\zeta^{a})=\sum_{j=1}^{p-1}\left(\frac{j}{p}\right)\zeta^{aj}.$

Making the change of variables, $k=aj$ we have

$G(\zeta^{a})=\sum_{k=1}^{p-1}\left(\frac{a^{-1}k}{p}\right)\zeta^{k}.$

By multiplicativity of the Legendre symbol and $(a/p)=(a^{-1}/p)$ we have

$G(\zeta^{a})=\left(\frac{a^{-1}}{p}\right)\tau$

where

$\tau=\sum_{k=1}^{p-1}\left(\frac{k}{p}\right)\zeta^{k}.$

By Corollary 4.6 of [13], $\tau$ evaluates to

$\tau=\begin{cases}\sqrt{p},&\text{if }p\equiv 1\left(\mathrm{mod}\
4\right)\\\ i\sqrt{p},&\text{if }p\equiv 3\left(\mathrm{mod}\
4\right).\end{cases}$

The result follows. ∎

Given an element $\alpha\in K$ and
$\beta=\sum_{g\in\Gamma}a_{g}g\in\mathbb{Q}[\Gamma]$, we will use the notation

$\alpha^{\beta}:=\prod_{g\in\Gamma}g(\alpha)^{a_{g}}.$

We remark that given $x\in\mathbb{Q}$,

$x^{G}=1$

as the character sum vanishes, and $x$ is fixed by every group element.

The Dirichlet class number formula can then be written using the group ring
formalism as follows. If $p\equiv 1\left(\mathrm{mod}\ 4\right)$,
$\varepsilon$ is the fundamental unit of $\mathbb{Q}(\sqrt{p})$ and $h$ is the
class number, then we have the familiar formula

$2h\log\varepsilon=-\sum_{j=1}^{p-1}\left(\frac{j}{p}\right)\log(1-\zeta^{j}).$
(8)

Here, we have crucially used that $p\equiv 1\left(\mathrm{mod}\ 4\right)$ to
evaluate the Gauss sum that appears in deriving (8). Exponentiating the
expression in (8), we have that

$\varepsilon^{2h}=(1-\zeta)^{-G},$

using our group ring formalism. As noted above, $x^{G}=1$ for any
$x\in\mathbb{Q}$, so

$\varepsilon^{2h}=(1-\zeta)^{-G}=(\zeta-1)^{-G}.$

If $n$ is a quadratic non-residue $\left(\mathrm{mod}\ p\right)$, we make a
change of variables in the sum defining $G$ by sending $j\mapsto nj$. Under
this change of variables, we have

$G=\sum_{j=1}^{p-1}\left(\frac{nj}{p}\right)\sigma_{nj}=-\sum_{j=1}^{p-1}\left(\frac{j}{p}\right)\sigma_{nj}.$

Hence,

$(1-\zeta)^{-G}=(1-\zeta^{n})^{G}$

from which it follows that

$\varepsilon^{2h}=(\zeta^{n}-1)^{G}.$

Combining the two formulas for $\varepsilon^{2h}$ gives

$\varepsilon^{4h}=\left(\frac{\zeta^{n}-1}{\zeta-1}\right)^{G}=\left(\frac{\zeta^{n}-1}{n(\zeta-1)}\right)^{G}$
(9)

since $n^{G}=1$.

We then have the following lemma,

######  Lemma 6.2.

Let $\zeta$ be a primitive $p$-th root of unity for $p$ a rational prime. For
a quadratic non-residue $\left(\mathrm{mod}\ p\right)$, set

$\alpha_{j}=\frac{\zeta^{nj}-1}{n(\zeta^{j}-1)}.$

Then $v_{p}(\alpha_{j}-1)\geq 1/(p-1)$.

###### Proof.

Writing $\omega=\zeta^{j}$, we have that

$\alpha_{j}=\frac{1-\omega^{n}}{1-\omega}=\sum_{k=0}^{n-1}\omega^{k}.$

Since $\zeta\equiv 1\left(\mathrm{mod}\ 1-\zeta\right)$, we deduce that
$\omega^{k}\equiv 1\left(\mathrm{mod}\ 1-\zeta\right)$ for all $1\leq k\leq
n-1$. Hence, $\alpha_{j}\equiv 1\left(\mathrm{mod}\ 1-\zeta\right)$.
Therefore, $(1-\zeta)^{p-1}$ divides $(\alpha_{j}-1)^{p-1}$. We have that
$(p)=(1-\zeta)^{p-1}$. Hence,

$(\alpha_{j}-1)^{p-1}\equiv 0\left(\mathrm{mod}\ p\right).$

In particular, as $v_{p}(x)$ is multiplicative we have that

$(p-1)v_{p}(\alpha_{j}-1)\geq 1.$

From which the desired conclusion follows. ∎

Observing that

$\left(\frac{\zeta^{n}-1}{n(\zeta-1)}\right)^{G}=\prod_{j=1}^{p-1}\left(\frac{\zeta^{nj}-1}{n(\zeta^{j}-1)}\right)^{\left(\frac{j}{p}\right)}$

and applying the $p$-adic logarithm to both sides of (9), we have that

$4h\log_{p}\varepsilon\equiv\sum_{j=1}^{p-1}\left(\frac{j}{p}\right)\log_{p}\left(\frac{\zeta^{nj}-1}{n(\zeta^{j}-1)}\right)\left(\mathrm{mod}\
p\right).$

By Theorem 5.1 and Lemma 6.2 we deduce the congruence

$4h\log_{p}\varepsilon\equiv\frac{1}{p}\sum_{j=1}^{p}\left(\frac{j}{p}\right)\left(\left(\frac{\zeta^{nj}-1}{n(\zeta^{j}-1)}\right)^{p}-1\right)\equiv\frac{1}{n^{p}}G\left(\frac{\left(\frac{\zeta^{n}-1}{\zeta-1}\right)^{p}-n}{p}\right)\left(\mathrm{mod}\
p\right).$

This is equivalent to

$4h\log_{p}(\varepsilon)\equiv\frac{1}{n}G(f(\zeta))\left(\mathrm{mod}\
p\right)$ (10)

where

$f(x)=\frac{1}{p}\left\\{\left(\frac{x^{n}-1}{x-1}\right)^{p}-\left(\frac{x^{np}-1}{x^{p}-1}\right)\right\\}.$

Noting that we can factor the two rational functions in the definition of
$f(x)$, we deduce that $f(x)$ is a polynomial in $x$:

$f(x)=\frac{1}{p}\left(\left(\sum_{k=0}^{n-1}x^{k}\right)^{p}-\sum_{j=0}^{n-1}x^{kp}\right).$
(11)

Moreover, as $\zeta^{p}=1$, we see that the second sum in (11) equals $n$ when
evaluated at $\zeta$. Therefore,
$f(\zeta)=\frac{1}{p}\left(\left(\frac{\zeta^{n}-1}{\zeta-1}\right)^{p}-n\right)$.
Following [2] we wish to simplify $f(x)\left(\mathrm{mod}\ p\right)$. In
particular:

######  Lemma 6.3.

For $f(x)$ as defined above,

$f(x)\equiv-\sum_{k=1}^{p-1}\sum_{j=0}^{\infty}\frac{1}{k}x^{nk+pj}+\sum_{k=1}^{p-1}\sum_{j=0}^{n-1}\frac{j+1}{k}x^{k+pj}\left(\mathrm{mod}\
p\right)$

where the first sum is over $nk+pj<pn$.

###### Proof.

We write $f(x)$ as

$f(x)=\frac{(x^{n}-1)^{p}(x^{p}-1)-(x^{pn}-1)(x-1)^{p}}{p}\cdot\frac{1}{(x-1)^{p}(x^{p}-1)}.$

Noting that $\frac{1}{p}{p\choose
k}\equiv\frac{(-1)^{k-1}}{k}\left(\mathrm{mod}\ p\right)$ for $1\leq k\leq
p-1$ we have

$\frac{(x-1)^{p}}{p}\equiv\frac{x^{p}-1}{p}-\sum_{k=1}^{p-1}\frac{x^{p-k}}{k}\left(\mathrm{mod}\
p\right).$

Writing $\ell=p-k$, the above expansion $f(x)$ can be written as

$f(x)\equiv\sum_{\ell=1}^{p-1}\frac{x^{n\ell}}{\ell(x^{p}-1)}-\sum_{\ell=1}^{p-1}\frac{x^{\ell}}{\ell}\cdot\frac{x^{pn}-1}{(x^{p}-1)^{2}}\left(\mathrm{mod}\
p\right).$

Writing

$\displaystyle\frac{1}{1-x^{p}}=\sum_{j=0}^{\infty}x^{pj}\,\,\,\,\,\text{ and
}\,\,\,\,\,\frac{1}{(1-x^{p})^{2}}=\sum_{j=0}^{\infty}(j+1)x^{pj},$
$f(x)\equiv-\sum_{\ell=1}^{p-1}\sum_{j=0}^{\infty}\frac{x^{n\ell+pj}}{\ell}+\sum_{\ell=1}^{p-1}\sum_{j=0}^{\infty}\frac{j+1}{\ell}x^{pj+\ell}-\sum_{\ell=1}^{p-1}\sum_{j=0}^{\infty}\frac{j+1}{\ell}x^{pj+pn+\ell}\left(\mathrm{mod}\
p\right).$

Changing the index of summation in the last sum above from $j\mapsto j-n$ we
have

$f(x)\equiv-\sum_{\ell=1}^{p-1}\sum_{j=0}^{\infty}\frac{x^{n\ell+pj}}{\ell}+\sum_{\ell=1}^{p-1}\sum_{j=0}^{\infty}\frac{j+1}{\ell}x^{pj+\ell}-\sum_{\ell=1}^{p-1}\sum_{j=n}^{\infty}\frac{j+1}{\ell}x^{pj+\ell}+\sum_{\ell=1}^{p-1}\sum_{j=n}^{\infty}\frac{n}{\ell}x^{pj+\ell}\left(\mathrm{mod}\
p\right).$

The two middle sums cancel to give a finite sum. Next, we observe that the
exponent in the last sum is over numbers greater than $pn$ and coprime to $p$.
As such, we can write the exponent $u=nv+pj$ for some
$v\in\\{1,\ldots,p-1\\}$. As such,

$u=nv+pj>pn\Rightarrow pj>n(p-v)>0.$

Hence, the exponent $u$ appears in the first sum as well. Making a change of
variables in the first sum of $\ell\mapsto n\ell$ we see that the term
corresponding to the exponent $u$ in the first sum has coefficient $-n/u$.
Therefore, the last sum entirely vanishes. In effect,

$f(x)\equiv-\sum_{\ell=1}^{p-1}\sum_{j=0}^{\infty}\frac{1}{\ell}x^{n\ell+pj}+\sum_{\ell=1}^{p-1}\sum_{j=0}^{n-1}\frac{j+1}{\ell}x^{pj+\ell}\left(\mathrm{mod}\
p\right)$

where the first sum is over all $n\ell+pj<pn$. ∎

Finally, we require one more computational tool.

######  Lemma 6.4.

Suppose $p\equiv 1\left(\mathrm{mod}\ 4\right)$. Then

$S=\sum_{k=1}^{p-1}\frac{1}{k}\left(\frac{k}{p}\right)\equiv
0\left(\mathrm{mod}\ p\right).$

###### Proof.

We observe that

$S\equiv\sum_{k=1}^{p-1}\frac{1}{p-k}\left(\frac{p-k}{p}\right)\equiv-\sum_{k=1}^{p-1}\frac{1}{k}\left(\frac{-k}{p}\right)\left(\mathrm{mod}\
p\right).$

Since $p\equiv 1\left(\mathrm{mod}\ 4\right)$, $(-1/p)=1$. Adding the two
representations of $S$, we deduce that

$2S\equiv 0\left(\mathrm{mod}\ p\right).$

Hence, $S\equiv 0\left(\mathrm{mod}\ p\right)$. ∎

######  Theorem 6.5 (Ankeny, Artin, Chowla, 1952).

Suppose $p\equiv 1\left(\mathrm{mod}\ 4\right)$. Let $h$ denote the class
number of $\mathbb{Q}(\sqrt{p})$ and $\varepsilon=(t+u\sqrt{p})/2$ be the
fundamental unit. Then

$4h\frac{u}{t}\equiv-\frac{1}{n}\sum_{k=1}^{p-1}\frac{1}{k}\left[\frac{nk}{p}\right]\left(\frac{k}{p}\right)\left(\mathrm{mod}\
p\right)$

for any quadratic non-residue $n\left(\mathrm{mod}\ p\right)$.

###### Proof.

Suppose $\zeta$ is a primitive $p$-th root of unity. Then by Lemma 6.3,

$f(\zeta)=-\sum_{\ell=1}^{p-1}\sum_{j=0}^{\infty}\frac{1}{\ell}\zeta^{n\ell}+\sum_{\ell=1}^{p-1}\frac{1}{\ell}(j+1)\zeta^{\ell}\left(\mathrm{mod}\
p\right)$

where the first sum is over all $n\ell+pj<pn$. In particular, there are
$1+\left[n\ell/p\right]$ such $j$ in the first sum. Changing the index of
summation in the first sum from $\ell\mapsto p-\ell$ we have

$f(\zeta)\equiv\sum_{\ell=1}^{p-1}\frac{1+\left[\frac{n\ell}{p}\right]}{\ell}\zeta^{-n\ell}+\frac{n(n+1)}{2}\sum_{\ell=1}^{p-1}\frac{1}{\ell}\zeta^{\ell}\left(\mathrm{mod}\
p\right).$

Then applying the element $G$ as defined in (10) and using linearity of $G$,
we have

$G(f(\zeta))\equiv\sum_{\ell=1}^{p-1}\frac{1+\left[\frac{n\ell}{p}\right]}{\ell}G(\zeta^{-n\ell})+\frac{n(n+1)}{2}\sum_{\ell=1}^{p-1}\frac{1}{\ell}G(\zeta^{\ell})\left(\mathrm{mod}\
p\right).$

By Lemma 6.1, this reduces to

$G(f(\zeta))\equiv\sqrt{p}\sum_{\ell=1}^{p-1}\left(\frac{-n\ell}{p}\right)\frac{1+\left[\frac{n\ell}{p}\right]}{\ell}+\frac{n(n+1)}{2}\sqrt{p}\sum_{\ell=1}^{p-1}\frac{1}{\ell}\left(\frac{\ell}{p}\right)\left(\mathrm{mod}\
p\right)$

Expanding the first sum out, applying Lemma 6.4, and noting that $-n$ is a
quadratic non-residue $\left(\mathrm{mod}\ p\right)$, we deduce that

$G(f(\zeta))\equiv-\sqrt{p}\sum_{\ell=1}^{p-1}\frac{1}{\ell}\left[\frac{n\ell}{p}\right]\left(\frac{\ell}{p}\right)\left(\mathrm{mod}\
p\right).$

Therefore,

$4h\log_{p}(\varepsilon)\equiv-\sqrt{p}\sum_{\ell=1}^{p-1}\frac{1}{\ell}\left[\frac{n\ell}{p}\right]\left(\frac{\ell}{p}\right)\left(\mathrm{mod}\
p\right).$

Noting that

$\log_{p}(\varepsilon)\equiv\frac{u\sqrt{p}}{t}\left(\mathrm{mod}\ p\right),$

we conclude the result. ∎

##  7 Concluding remarks

We have presented a self-contained treatment of some of the results in [2] and
[4]. We generalized the AAC conjecture in Theorem 2.1 and thus, related the
AAC conjecture to a congruence of Fermat quotients. This generalization
allowed us to obtain a generalization of a result of Eisenstein relating
Fermat quotients to sums of harmonic numbers.

The function field analogue of the Ankeny-Artin-Chowla conjecture has been
studied by Yu and Yu [15]. The case $p\equiv 3\pmod{4}$ has been studied by
Mordell [7] and [8] and he made a similar conjecture. In all cases, we have an
interesting connection to Bernoulli numbers. In particular, if there are
infinitely many regular primes (that is, primes $p$ that do not divide the
class number of the $p$-th cyclotomic field), then the Ankeny-Artin-Chowla and
the Mordell conjectures are true for those primes $p$. It is unknown at
present whether there are infinitely many regular primes though the conjecture
is that there is a positive density of such primes. A relevant survey article
by Slavutskii [10] is worth a careful study.

## References

  * AAC [51] N. C. Ankeny, E. Artin, and S. Chowla.  The Class-Number of Real Quadratic Fields.  Proceedings of the National Academy of Sciences, 37(8):524–525, 1951.
  * AAC [52] N. C. Ankeny, E. Artin, and S. Chowla.  The Class-Number of Real Quadratic Number Field.  Annals of Mathematics, 56(3):479–493, 1952.
  * AC [60] N. C. Ankeny and S. Chowla.  A note on the class number of real quadratic fields.  Acta Arith, 6:145–147, 1960.
  * Car [53] L. Carlitz.  Note on the Class Number of Real Quadratic Fields.  Proceedings of the American Mathematical Society, 4(4):535–537, 1953.
  * Eis [50] F. Eisenstein.  Eine neue Gattung zahlentheoretischer Funktionen, welche von zwei Elementen ahhängen und durch gewisse lineare Funktional-Gleichungen definirt werden.  Berichte Königl. Preuß. Akad, 15:36–42, 1850.
  * ME [05] M. Ram Murty and J. Esmonde.  Problems in algebraic number theory, volume 190 of Graduate Texts in Mathematics.  Springer-Verlag, New York, second edition, 2005.
  * Mor [60] L. J. Mordell.  On a pellian equation conjecture.  Acta Arith., 6:137–144, 1960.
  * Mor [61] L. J. Mordell.  On a Pellian equation conjecture. II.  J. London Math. Soc., 36:282–288, 1961.
  * Mur [99] M. Ram. Murty.  Exponents of class groups of quadratic fields.  Mehta Research Institute of Mathematics and Mathematical Physics,, Allahabad, India :, 1999.
  * Sla [04] I. Sh. Slavutskii.  Real Quadratic Fields and the Ankeny–Artin–Chowla Conjecture.  Journal of Mathematical Sciences, 122(6):3673–3678, 2004.
  * vdPtRW [01] A. J. van der Poorten, H. J. J. te Riele, and H. C. Williams.  Computer verification of the Ankeny-Artin-Chowla conjecture for all primes less than $100\,000\,000\,000$.  Math. Comp., 70(235):1311–1328, 2001.
  * VDPtRW [03] A. J. Van Der Poorten, H. J. J. te Riele, and H. C. Williams.  Corrigenda and addition to: “Computer verification of the Ankeny-Artin-Chowla conjecture for all primes less than $100\,000\,000\,000$” [Math. Comp. 70 (2001), no. 235, 1311–1328; MR1709160 (2001j:11125)].  Math. Comp., 72(241):521–523, 2003.
  * Was [82] L. Washington.  Introduction to cyclotomic fields, volume 83 of Graduate Texts in Mathematics.  Springer-Verlag, New York, 1982.
  * YF [18] H. Yang and R. Fu.  The exponential diophantine equation $x^{y}+y^{x}=z^{2}$ via a generalization of the Ankeny-Artin-Chowla conjecture.  Int. J. Number Theory, 14(5):1223–1228, 2018.
  * YY [98] J. Yu and J-K. Yu.  A note on a geometric analogue of Ankeny-Artin-Chowla’s conjecture.  Contemporary Mathematics, 210:101–105, 1998.