Arithmetic-geometric mean sequences over finite fields 𝔽 q \mathbb{F}_{q} , where q ≡ 5 ( mod 8 ) q\equiv 5\pmod{8} Natália Bátorová, Stevan Gajović Abstract . Arithmetic-geometric mean sequences were already studied over real and complex numbers, and recently, Michael J. Griffin, Ken Ono, Neelam Saikia and Wei-Lun Tsai considered them over finite fields 𝔽 q \mathbb{F}_{q} such that q ≡ 3 ( mod 4 ) q\equiv 3\pmod{4} . In this paper, we extend the definition of arithmetic-geometric mean sequences over 𝔽 q \mathbb{F}_{q} such that q ≡ 5 ( mod 8 ) q\equiv 5\pmod{8} . We explain the connection of these sequences with graphs and show the properties of the corresponding graphs in the case q ≡ 5 ( mod 8 ) q\equiv 5\pmod{8} . 1. Introduction. The arithmetic-geometric mean sequence (AGM) is a sequence of ordered pairs where the first element of the pair is the arithmetic mean of the previous pair, and the second element of the pair is the geometric mean of the previous pair. AGM over positive real numbers was first discovered by Lagrange in 1785 and rediscovered by Gauss a few years later, in 1791. AGM sequences over real or complex numbers have many applications. AGM sequences can also be considered over finite fields. For example, Michael J. Griffin, Ken Ono, Neelam Saikia and Wei-Lun Tsai [ 8 ] introduced AGM over finite fields with q elements such that q\equiv 3\pmod{4} . In this case, they made a natural definition of infinite AGM for q>3 . However, it was not clear if we could define an infinite sequence over every finite field of odd characteristic. In this paper, we extend the definition over finite fields with q elements such that q\geq 29 and q\equiv 5\pmod{8} . This paper is based on the bachelor thesis [ 2 ] of the first author, cosupervised by the second author. Very recently, June Kayath, Connor Lane, Ben Neifeld, Tianyu Ni, Hui Xue, published a preprint [ 9 ] in which they generalise results from [ 8 ] and define and explain AGM sequences over all finite fields of odd characteristic. To do so, they used elliptic curves. On the other hand, our approach for q\equiv 5\pmod{8} was based on elementary number theory. 1.1. Main results The main results of this paper were entirely new to the authors, even though there is now a preprint [ 9 ] dealing with even more general cases. We define the AGM sequences over \mathbb{F}_{q} where q\equiv 5\pmod{8} , see Definition 5.8 and describe their corresponding graphs. First, we prove that each vertex of that graph has 0 or 2 incoming and outcoming edges by Lemma 5.1 and Corollaries 5.3 and 5.6 . We further prove that a nontrivial connected component of the graph, i.e., which has at least one edge, always contains a cycle, see Theorem 5.2 . This is the property we want from the AGM sequences over finite fields. We fully describe the corresponding graph in Theorem 5.7 and present a few sketches of such graphs; see Figures 2 and 3. Finally, we prove that for all q\geq 29 , q\equiv 5\pmod{8} , there is at least one cycle in the corresponding graph, see Theorem 5.9 . In addition, we prove slightly more generally that there is at least one connected component, all of whose vertices are squares (both components of the vertex are squares, see Definition 3.8 ); see Corollary 5.11 . However, we also slightly improve and generalise the results from [ 8 ] in Theorems 3.7 and 3.9 . More precisely, we analyse components of the corresponding graphs more precisely and give a little better divisibility conclusion that in [ 8 , Theorem 1(4)] . 1.2. Structure of the paper For the convenience of readers, we start with briefly discussing various applications of the AGM sequences in Section 2 . In Section 3 , we introduce the AGM sequences over finite fields and their corresponding graphs. We always use Definition 3.4 for the corresponding graph of the AGM sequence. We mostly follow [ 8 ] , but we include our improved results there. We summarise the results from [ 8 ] in Section 4 . Section 5 contains our main results, which were introduced in section 1.1 . In Section 6 , we explain the strategy used to switch from q\equiv 3\pmod{4} to q\equiv 5\pmod{8} and why this strategy does not work for q\equiv 1\pmod{8} . We recall that so far, one needs to use elliptic curves for this case, as in [ 9 ] . We finish this paper with a challenge for interested readers to try to discover an elementary solution to extend the AGM sequences for q\equiv 1\pmod{8} . 2. AGM over \mathbb{R} and \mathbb{C} and their applications. Definition 2.1 . Let a,b be positive real numbers. The sequence AGM_{\mathbb{R}}(a,b)=((a_{n},b_{n}))_{n=0}^{\infty} is defined as follows. Let a_{0}=a , b_{0}=b and for n>0 , we define \displaystyle a_{n} \displaystyle:=\frac{a_{n-1}+b_{n-1}}{2}, \displaystyle b_{n}: \displaystyle=\sqrt{a_{n-1}b_{n-1}}. As it is clear from Definition 2.1 that (a_{n})_{n\in\mathbb{N}} and (b_{n})_{n\in\mathbb{N}} have the same limit, we denote M(a,b)\mathrel{\mathchoice{\vbox{\hbox{$\displaystyle:$}}}{\vbox{\hbox{$\textstyle:$}}}{\vbox{\hbox{$\scriptstyle:$}}}{\vbox{\hbox{$\scriptscriptstyle:$}}}{=}}\lim_{n\rightarrow\infty}a_{n}=\lim_{n\rightarrow\infty}b_{n}. AGM sequences have applications in mathematical analysis, geometry, number theory, etc. Here, we explain some of these applications without going into too many details. Perhaps the most famous application is that one can use AGM_{\mathbb{R}} for rapidly computing digits of \pi . The following algorithm was based on Gauss’s work and was independently discovered by Brent and Salamin; see [ 4 , p.48-49] for more details. Gauss, in 1799, already noticed that AGM sequences are connected with elliptic integrals of the first kind; see more details in [ 4 , Theorem 1.1] . We have \dfrac{1}{M(1,\sqrt{2})}=\dfrac{2}{\pi}\int_{0}^{1}\dfrac{dx}{\sqrt{1-x^{2}}}=\dfrac{2}{\pi}\int_{0}^{\frac{\pi}{2}}\dfrac{d\theta}{\sqrt{1+\sin^{2}\theta}}. In fact, it is interesting to note that elliptic integrals are invariant on the AGM sequence. For T(a,b)=\dfrac{2}{\pi}\int_{0}^{\frac{\pi}{2}}\dfrac{d\theta}{\sqrt{a^{2}\cos^{2}\theta+b^{2}\sin^{2}\theta}} and for ((a_{n},b_{n}))_{n=0}^{\infty}=AGM_{\mathbb{R}}(a,b) , we have T(a,b)=T(a_{n},b_{n}) for each n . Further, one can use these results to compute that the length of the lemniscate given in the polar coordinates as r^{2}=\cos 2\theta is \frac{2\pi}{M(1,\sqrt{2})}\approx 5.244; more details can be found at [ 6 , p.280] . Also, we recommend [ 4 ] and [ 6 ] for finding more material on the AGM sequences and their applications. Finally, we note that one can compute the inverse tangent function using AGM sequences in the following way (see [ 1 , p. 6-10] ) \tan^{-1}x=\lim_{n\rightarrow\infty}\dfrac{x}{a_{n}\sqrt{1+x^{2}}},\;\text{where}\;((a_{n},b_{n}))_{n=0}^{\infty}=AGM_{\mathbb{R}}\left(\dfrac{1}{\sqrt{1+x^{2}}},1\right). The AGM sequence can be defined over \mathbb{C} as well. It is unclear which square root to take for the next term, and there are many choices (two in each step, hence, uncountably many!). However, all but countably many such sequences satisfy that both coordinates converge to 0. To avoid this, one introduces a condition for the starting pair (a,b) ; see, e.g., [ 6 , Section 2, Proposition 2.1] . The arithmetic-geometric mean M(a,b) can be regarded as a multiple-valued function of a and b . We briefly mention applications in number theory. The AGM sequences can be connected to the theta functions, hence to modular forms, see, e.g., [ 4 , Sections 2, 3] or [ 6 ] . Hence, it is not surprising that AGM sequences can be applied to the arithmetic of elliptic curves, for instance, for computing canonical heights on them (e.g., see [ 7 ] and the PhD thesis of Thongjunthug [ 11 ] ) or to compute or for point counting and computing the Serre-Tate lift (e.g., see the PhD thesis of Carls [ 5 ] ). So, the connection between elliptic curves and AGM sequences could serve as a motivation in [ 8 ] and [ 9 ] for the authors to use elliptic curves to study the AGM sequences over finite fields. 3. AGM as a directed graph over finite fields. In the whole paper, let q be an odd prime power and \mathbb{F}_{q} the field with exactly q elements. We briefly recall some well-known properties of \mathbb{F}_{q} that we will use many times. Definition 3.1 . Let x\in\mathbb{F}_{q}^{\times} , then x is a quadratic residue if there exists y\in\mathbb{F}_{q} such that y^{2}=x. If there is not such y , x is a quadratic non-residue. We will also call quadratic residues squares and non-residues non-squares. Definition 3.2 . Let \phi_{q}\colon\mathbb{F}_{q}^{\times}\to\{\pm 1\} such that for every a\in\mathbb{F}_{q} the following holds: \phi_{q}(a)=\begin{cases}1&\text{if $a$ is a quadratic residue};\\ -1&\text{if $a$ is a quadratic non-residue}.\end{cases} It is well-known that \phi_{q}\colon\mathbb{F}_{q}^{\times}\to\{\pm 1\} is a homomorphism. We use some standard notions from the graph theory, which can be found, e.g., in [ 3 , Chapters 1, 10] . We just recall one definition. Definition 3.3 . Let u,v be vertices in a directed graph. Then we will call u a parent of v if there is an edge u\rightarrow v . We will call u a child of v if there is an edge v\rightarrow u . Now, we are able to define a directed graph which will represent the AGM sequences over \mathbb{F}_{q} . Definition 3.4 . Define a directed graph \mathcal{J}_{\mathbb{F}_{q}}=(V,E) as follows: V=\{(a,b)\in{\mathbb{F}_{q}^{\times}}^{2}\mid\phi_{q}(ab)=1,a\neq\pm b\} and (a,b)\rightarrow(c,d) is an edge if and only if \displaystyle c \displaystyle=\frac{a+b}{2} \displaystyle d^{2} \displaystyle=ab. We will denote the components of \mathcal{J}_{\mathbb{F}_{q}} as J_{i} and the number of components d(\mathbb{F}_{q}) . Even though the following lemma is mostly contained in [ 8 , Theorem 1 (3)] , for the convenience of the reader, we state it here with proof and emphasize that it does not depend on q modulo 4. Lemma 3.5 . Let (a,b) be a vertex of \mathcal{J}_{\mathbb{F}_{q}} . Then (a,b) has a parent if and only if \phi_{q}(a^{2}-b^{2})=1 . Furthermore, if (a,b) has a parent, there are exactly two parents, namely, (a+S,a-S) and (a-S,a+S) , where S^{2}=a^{2}-b^{2} . Proof. Suppose that (a,b) has a parent (A,B) . We have A+B=2a and AB=b^{2} , so A and B are roots of the quadratic polynomial x^{2}-2ax+b^{2}=(x-A)(x-B) . Hence, the only two parents of (a,b) are exactly (A,B) and (B,A) . Furthermore, \phi_{q}(a^{2}-b^{2})=\phi_{q}(\frac{1}{4}(A-B)^{2})=1 . On the other hand, if \phi_{q}(a^{2}-b^{2})=1 , there exist S\in\mathbb{F}_{q}^{\times} such that S^{2}=a^{2}-b^{2}\neq 0 . Then, we can consider the vertex (a+S,a-S) as a+S\neq\pm(a-S) and \phi_{q}\left((a+S)(a-S)\right)=\phi_{q}(a^{2}-S^{2})=\phi_{q}(a^{2}-(a^{2}-b^{2}))=\phi_{q}(b^{2})=1. Since we have \frac{(a+S)+(a-S)}{2}=a\;\;\text{and}\;\;(a+S)(a-S)=b^{2}, it follows that (a+S,a-S) is a parent of (a,b) and similarly for (a-S,a+S) . ∎ The graph \mathcal{J}_{\mathbb{F}_{q}} has a group of natural automorphisms, as proven in [ 8 , Theorem 1(4)] . Lemma 3.6 . Every \alpha\in\mathbb{F}_{q}^{\times} induces a distinct graph automorphism \displaystyle\varphi_{\alpha}\colon\mathcal{J}_{\mathbb{F}_{q}} \displaystyle\to\mathcal{J}_{\mathbb{F}_{q}} \displaystyle(a,b) \displaystyle\mapsto(\alpha a,\alpha b). Furthermore, G=\{\varphi_{\alpha}\mid\alpha\in\mathbb{F}_{q}^{\times}\}\simeq\mathbb{F}_{q}^{\times} is a group under the obvious group law. We look at the components of \mathcal{J}_{\mathbb{F}_{q}} . Let N_{n} denote the number of components of \mathcal{J}_{\mathbb{F}_{q}} with n vertices. Then, [ 8 , Theorem 1(4)] states that (q-1)|nN_{n} . However, we can prove a slightly better result. Namely, for any positive integer n , denote by M_{n} the number of oriented cycles of the length n . When q\equiv 3\pmod{4} , [ 8 , Theorem 1(3,4)] implies that in this situation we have nM_{n}=\frac{1}{2}nN_{n} . Theorem 3.7 . For any positive integer n , we have (q-1)|nM_{n} . Proof. Consider G from Lemma 3.6 , the group of graph automorphisms \varphi_{\alpha} such that \alpha\in\mathbb{F}_{q}^{\times} . This group acts on the \mathcal{J}_{\mathbb{F}_{q}} . Note that every orbit of a vertex has size q-1 as (\alpha a,\alpha b)\neq(\beta a,\beta b) for \alpha\neq\beta and (a,b)\in V . Furthermore, a vertex from a cycle is mapped to a vertex from a cycle of the same size. This implies that q-1 divides the number of all vertices which are in the cycles of the same length, so q-1\mid nM_{n} . ∎ We can make one more observation which has not been mentioned in [ 8 ] . Definition 3.8 . We call the vertex (a,b)\in V a square vertex if a and b are both squares. The other vertices in V are called non-square vertices. Theorem 3.9 . • If the edge in the component connects two square vertices, then all the vertices in the component are square vertices. • If the edge in the component connects two non-square vertices, then all the vertices in the component are non-square. • If the edge in the component connects a square vertex and a non-square vertex, then in the component, the square and non-square vertices alternate, so there is no edge in this component connecting two square vertices or two non-square vertices. Proof. The proof will follow from the following lemma. Lemma 3.10 . Consider the path (a,b)\rightarrow(c,d)\rightarrow(e,f) . Then (a,b) is a square vertex if and only if (e,f) is a square vertex. Proof. Suppose (a,b) is a square vertex, so a=A^{2} and b=B^{2} . Then \displaystyle c \displaystyle=\frac{A^{2}+B^{2}}{2} \displaystyle d^{2} \displaystyle=A^{2}B^{2}, which means that d=\pm AB , implying e=\frac{c+d}{2}=\left(\frac{A\pm B}{2}\right)^{2}. Then, by Definition 3.4 , f is a square. Now, assume that (a,b) is a non-square vertex. Let \alpha\in\mathbb{F}_{q}^{\times} be a non-square and consider the graph automorphism \varphi_{\alpha}((a,b))=(\alpha a,\alpha b) . Then \displaystyle(a,b)\rightarrow(c,d)\rightarrow(e,f) \displaystyle\mapsto \displaystyle\varphi_{\alpha}((a,b))\rightarrow\varphi_{\alpha}((c,d))\rightarrow\varphi_{\alpha}((e,f)). Since \phi_{q}(\alpha a)=(-1)(-1)=1 , \varphi_{\alpha}((a,b)) is a square vertex. We have already proved that \varphi_{\alpha}((e,f)) is a square vertex and as \varphi_{\alpha}((e,f))=(\alpha e,\alpha f) , we have \phi_{q}(e)=-1 , which completes the proof of the lemma. ∎ Hence, if we have a path between two vertices that are both squares or non-squares, then all vertices are of the same time; otherwise, they will alternate. ∎ Corollary 3.11 . Let n be an odd positive integer. Then, M_{n} is even. Proof. It follows directly from Theorem 3.7 as q-1 is even. But now we have a new insight after Theorem 3.9 . Namely, such directed circles cannot have alternating vertices. Hence, all of their vertices have to be squares or non-squares, and there is an equal number of them. ∎ 4. AGM over \mathbb{F}_{q} , where {q\equiv 3\pmod{4}} . We now recall the results from [ 8 ] , which served as an inspiration for our work. In the whole section, we assume q\equiv 3\pmod{4} . Then, we know that -1 is a quadratic non-residue in \mathbb{F}_{q} . Lemma 4.1 . Let \varepsilon\in\{\pm 1\} , x\in\mathbb{F}_{q}^{\times} . If \phi_{q}(x)=1 , then there is a unique y\in\mathbb{F}_{q}^{\times} such that y^{2}=x and \phi_{q}(y)=\varepsilon . We will denote \sqrt[\scriptstyle\varepsilon]{x}=y . Proof. Let t\in\mathbb{F}_{q}^{\times} be so that t^{2}=x . Then \phi_{q}(t)=-\phi_{q}(-t) , so either \phi_{q}(t)=\varepsilon or \phi_{q}(-t)=\varepsilon . ∎ Definition 4.2 . Let a,b\in\mathbb{F}_{q}^{\times} such that \phi_{q}(ab)=1 and a\neq\pm b . We define a sequence AGM_{\mathbb{F}_{q}}(a,b)=((a_{n},b_{n}))_{n=0}^{\infty} such that a_{0}=a , b_{0}=b and \displaystyle a_{n} \displaystyle=\frac{a_{n-1}+b_{n-1}}{2}; \displaystyle\varepsilon \displaystyle=\phi_{q}(a_{n}), \displaystyle b_{n} \displaystyle=\sqrt[\scriptstyle\varepsilon]{a_{n-1}b_{n-1}}. Example 4.3 . Let q=3 . We have \mathbb{F}_{q}^{\times}=\{1,-1\} so there is no (a,b) such that a\neq\pm b . For q\geq 7 , AGM_{\mathbb{F}_{q}}(\cdot,\cdot) is an infinite sequence (a_{n},b_{n})_{n\in\mathbb{N}}\in{\mathbb{F}_{q}^{\times}}^{2} , such that a_{n}b_{n}(a_{n}^{2}-b_{n}^{2})\neq 0 . Example 4.4 . Consider q=11 . Then, \displaystyle AGM_{\mathbb{F}_{11}}(4,1)=( \displaystyle\overline{(4,1),(8,2),(5,4),(10,8),(9,5),(7,10),(3,9),(6,7),(1,3),(2,6)}) \displaystyle AGM_{\mathbb{F}_{11}}(1,4)=( \displaystyle(1,4),\overline{(8,2),(5,4),(10,8),(9,5),(7,10),(3,9),(6,7),(1,3),(2,6),(4,1)}) \displaystyle AGM_{\mathbb{F}_{11}}(9,1)=( \displaystyle\overline{(9,1),(5,3),(4,9),(1,5),(3,4)}) \displaystyle AGM_{\mathbb{F}_{11}}(1,9)=( \displaystyle(1,9),\overline{(5,3),(4,9),(1,5),(3,4),(9,1)}), where the line above a sequence means it is a repeating period. Example 4.5 . For q=11 , \mathcal{J}_{\mathbb{F}_{q}} consists of 3 connected components given above. Figure 1. Components of \mathcal{J}_{\mathbb{F}_{11}} Now, let us have a look at the graph of \mathcal{J}_{\mathbb{F}_{q}} . We will see that the components have a special shape, which is not a coincidence, as it is proven in [ 8 , Theorem 1] . Theorem 4.6 . (1) \mathcal{J}_{\mathbb{F}_{q}} has (q-1)(q-3)/2 vertices. (2) Every component of \mathcal{J}_{\mathbb{F}_{q}} consists of one directed cycle, and there is a directed path of the length 1 to every vertex of that cycle. There are no other cycles (even undirected). When we draw the component of \mathcal{J}_{\mathbb{F}_{q}} in the plane, it looks like a bell head with tentacles. Hence the components of \mathcal{J}_{\mathbb{F}_{q}} are playfully called jellyfishes and the graph \mathcal{J}_{\mathbb{F}_{q}} is a jellyfish swarm in [ 8 ] . 5. AGM over \mathbb{F}_{q} , where {q\equiv~5~\pmod{8}} . This section contains our new results, which are independent of those in [ 9 ] , even though, not surprisingly, there are overlaps, especially with [ 9 , Section 4] . In the whole section, let q\equiv 5\pmod{8} ; then -1 is a square in \mathbb{F}_{q} , but 2 and i , such that i^{2}=-1 are not. Lemma 5.1 . Let (a,b) be a vertex of \mathcal{J}_{\mathbb{F}_{q}} . Then (a,b) has either 2 or 0 children. Proof. Suppose (a,b) has a child (A,B) , so \phi_{q}(AB)=1 . The equation x^{2}=ab has exactly two solutions, B and -B . Then, \phi_{q}(A\cdot(-B))=1 so, (A,-B) is the other child. ∎ Recall that (a,b) has either 2 or 0 parents from Lemma 3.5 . Theorem 5.2 . Let E be the set of edges of \mathcal{J}_{\mathbb{F}_{q}} . If E\neq\emptyset , then there is a cycle in \mathcal{J}_{\mathbb{F}_{q}} . Proof. Consider the edge (a,b)\rightarrow(A,B) in \mathcal{J}_{\mathbb{F}_{q}} . Then the other child of (a,b) is (A,-B) . Consider the pairs (c,d) and (e,f) (which do not have to be vertices of \mathcal{J}_{\mathbb{F}_{q}} ) such that \displaystyle c \displaystyle=\frac{A+B}{2} \displaystyle d^{2} \displaystyle=AB \displaystyle e \displaystyle=\frac{A-B}{2} \displaystyle f^{2} \displaystyle=-AB. Then d=\pm if , where i\in\mathbb{F}_{q} is such that i^{2}=-1 , and we compute \phi_{q}(cdef)=\phi_{q}(ce)\phi_{q}(\pm if^{2})=\phi_{q}\left(\frac{A^{2}-B^{2}}{4}\right)\cdot\phi_{q}(\pm 1)\phi_{q}(i)\phi_{q}(f^{2})=\phi_{q}\left(\left(\frac{a-b}{4}\right)^{2}\right)\cdot(-1)=-1. As cdef is a quadratic non-residue, exactly one of cd and ef is a quadratic residue, so exactly one of (c,d) , (e,f) is a vertex. So, we can make the path longer and continue analogously for either (A,B) or (A,-B) , but not both. As we can continue this way in every step, and the number of vertices is finite, there must be a cycle in \mathcal{J}_{\mathbb{F}_{q}} . ∎ Corollary 5.3 . Let C\subseteq V be the set of vertices in a cycle. Then, every c\in C has exactly two children; one is a part of the cycle, and the other does not have any children. Proof. Suppose c_{1}\in C has exactly two children, c_{2} and d_{2} . Suppose c_{2}\in C , so it has exactly two children, c_{3} and c_{3}^{\prime} . Hence, by the proof of Theorem 5.2 , then d_{2} cannot have any children. ∎ Theorem 5.4 . Let C be the cycle in \mathcal{J}_{\mathbb{F}_{q}} , then there are more than two vertices in C . Proof. Suppose that there are edges (a,b)\rightarrow(c,d) and (c,d)\rightarrow(a,b) in \mathcal{J}_{\mathbb{F}_{q}} . Then, c=\frac{a+b}{2}\;\;\text{and}\;\;a=\frac{c+d}{2}\;\;\text{imply}\;\;a+c=b+d. Also, d^{2}=ab and b^{2}=cd implies ac=bd . By Vieta’s formulas, (x-a)(x-c)=(x-b)(x-d)\in\mathbb{F}_{q}[x] , so \{a,b\}=\{c,d\} . Recall that by Definition 3.4 , we have a\neq b , hence, suppose a=d,b=c . So, we have an edge (a,b)\rightarrow(b,a) which gives us b=\frac{a+b}{2} , thus b=a , a contradiction. ∎ Theorem 5.5 . Consider the path (a,b)\rightarrow(c,d)\rightarrow(e,f) in \mathcal{J}_{\mathbb{F}_{q}} . Then, there is another path (g,h)\rightarrow(d,c)\rightarrow(e,f) and exactly one of the vertices (a,b),(g,h) has parents. Proof. By Lemma 3.5 , we have \phi_{q}(c^{2}-d^{2})=1 , so \phi_{q}(d^{2}-c^{2})=1 . Then, by Lemma 3.5 , there exist parents (g,h) of (d,c) . Also, by Lemma 3.5 , we know that there are x,y\in\mathbb{F}_{q}^{\times} such that a=c-x , b=c+x , and x^{2}=c^{2}-d^{2} , and g=d-y , h=d+y , and y^{2}=d^{2}-c^{2} . We can compute \displaystyle\phi_{q}((a^{2}-b^{2})(g^{2}-h^{2})) \displaystyle=\phi_{q}\left(\left((c-x)^{2}-(c+x)^{2}\right)\left((d-y)^{2}-(d+y)^{2}\right)\right) \displaystyle=\phi_{q}(16\cdot cx\cdot dy)=\phi_{q}(16)\phi_{q}(cd)\phi_{q}(xy)=\phi_{q}(xy)=-1, because y=\pm ix . Thus, either (a^{2}-b^{2}) or (g^{2}-h^{2}) is a quadratic residue. By Lemma 3.5 , either (a,b) or (g,h) has parents, and the other does not. ∎ Corollary 5.6 . Let C\subseteq V be the set of vertices in a cycle. Then every c\in C has exactly 2 parents; one is part of the cycle C , and the other is not part of any cycle. Proof. Suppose c\in C and recall by Theorem 5.4 that the length of a cycle is at least 3 , so we can consider the path c_{1}\rightarrow c_{2}\rightarrow c of vertices from the cycle. As c has another parent {c_{2}}^{\prime} , by Theorem 5.5 we know there is another path {c_{1}}^{\prime}\rightarrow{c_{2}}^{\prime}\rightarrow c , hence exactly one of the vertices c_{1} and c_{1}^{\prime} has parents by Theorem 5.5 . As c_{1}\in C , it has parents, hence c_{1}^{\prime} does not have parents. ∎ When we join all the previous claims about \mathcal{J}_{\mathbb{F}_{q}} together, we obtain the following theorem. It is useful to look at Figure 2 for the proof of Theorem 5.7 . Theorem 5.7 . Every component of \mathcal{J}_{\mathbb{F}_{q}} is made either of single vertex or of the cycle c_{1}\rightarrow c_{2}\rightarrow\dots\rightarrow c_{n} , vertices u_{i} such that c_{i}\rightarrow u_{i+1} , vertices v_{i} such that v_{i}\rightarrow c_{i} and v_{i}\rightarrow u_{i} and vertices w_{i} such that w_{i}\rightarrow v_{i} , w_{n+i}\rightarrow v_{i} and vertices x_{i} such that w_{i}\rightarrow x_{i} , w_{n+i}\rightarrow x_{i} . These are all edges and vertices of a nontrivial component of \mathcal{J}_{\mathbb{F}_{q}} . Figure 2. A general nontrivial component of \mathcal{J}_{\mathbb{F}_{q}} such that q\equiv 5\pmod{8} Proof. Assume there is a cycle C of length n (otherwise, by Theorem 5.2 , only vertices are the components). Consider the path c_{n}=(a_{n},b_{n})\rightarrow c_{1}=(a_{1},b_{1})\rightarrow c_{2}=(a_{2},b_{2}) . By Corollary 5.3 , c_{1} has two children, one is c_{2}=(a_{2},b_{2}) in the cycle, and the other one is u_{2}=(a_{2},-b_{2}) , which is not in the cycle and has no children. We also know that there is another parent of c_{2} and u_{2} , which is v_{2}=(b_{1},a_{1}) . Since c_{1}=(a_{1},b_{1}) has parents because c_{1}\in C , this implies that \phi_{q}(a_{1}^{2}-b_{1}^{2})=1 , and so \phi_{q}(b_{1}^{2}-a_{1}^{2})=1 , thus v_{2}=(b_{1},a_{1}) also has parents by Lemma 3.5 . Let these parents be w_{2}=(e_{1},f_{1}) and w_{2+n}=(f_{1},e_{1}) , and they have another child x_{2}=(b_{1},-a_{1}) . Since v_{2} has children, we know that x_{2} has no children. Now, we apply Theorem 5.5 to the paths c_{n}\rightarrow c_{1}\rightarrow c_{2} and w_{2}\rightarrow v_{2}\rightarrow c_{2} (or w_{n+2}\rightarrow v_{2}\rightarrow c_{2} ) to conclude that w_{2} and w_{n+2} have no parents because c_{n}\in C , so it has parents. This completes the proof and explains the components containing a cycle in a bit more detail. ∎ Definition 5.8 . Let q\equiv 5\pmod{8} and (a,b)\in{\mathbb{F}_{q}^{\times}}^{2} such that ab(a^{2}-b^{2})\neq 0 , \phi_{q}(ab)=1 and there exist c,d\in\mathbb{F}_{q}^{\times} such that cd(c^{2}-d^{2})\neq 0 and \displaystyle c \displaystyle=\frac{a+b}{2}, \displaystyle d^{2} \displaystyle=ab, \displaystyle\phi_{q}(cd)=1. Let C be the component of \mathcal{J}_{\mathbb{F}_{q}} , which contains the vertex (a,b) , and suppose it contains a cycle of the length n . Then, using the notation from Theorem 5.7 , without loss of generality, we may assume (a,b)\in\{c_{1},v_{1},w_{1}\} . We define an infinite arithmetic-geometric mean sequence as follows: AGM_{\mathbb{F}_{q}}(a,b)=\begin{cases}(\overline{c_{1},c_{2},\dots,c_{n}})&\text{if }(a,b)=c_{1},\\ (v_{1},\overline{c_{1},c_{2},\dots,c_{n}})&\text{if }(a,b)=v_{1},\\ (w_{1},v_{1},\overline{c_{1},c_{2},\dots,c_{n}})&\text{if }(a,b)=w_{1}.\end{cases} Recall that we denote the repeating period by line over elements of the sequence. Theorem 5.9 . If q\geq 29 and q\equiv 5\pmod{8} , then there is at least one nontrivial component. Proof. We prove that there is a vertex (a,b) in \mathcal{J}_{\mathbb{F}_{q}} which has parents, i.e., with \phi_{q}(a^{2}-b^{2})=1 by Lemma 3.5 . Let g be a generator of the group \mathbb{F}_{q}^{\times} . As q\geq 29 , we have g^{2},g^{4},g^{6}\notin\{1,-1\} , so we can consider vertices (g^{2},1) , (g^{4},1) , (g^{6},1) . If any of \displaystyle(g^{2})^{2}-1^{2} \displaystyle=g^{4}-1, \displaystyle(g^{4})^{2}-1^{2} \displaystyle=g^{8}-1, \displaystyle(g^{6})^{2}-1^{2} \displaystyle=g^{12}-1 is a square, and then we find a vertex with its parents. Suppose none of them is a square, then \displaystyle-1 \displaystyle=\phi_{q}(g^{8}-1)=\phi_{q}((g^{4}-1)(g^{4}+1))=-\phi(g^{4}+1),\;\text{therefore},\;\phi(g^{4}+1)=1; \displaystyle-1 \displaystyle=\phi_{q}(g^{12}-1)=\phi_{q}((g^{4}-1)(g^{8}+g^{4}+1))=-\phi_{q}(g^{8}+g^{4}+1),\;\text{therefore},\;\phi_{q}(g^{8}+g^{4}+1)=1. So, there are a,b\in\mathbb{F}_{q}^{\times} such that a^{2}=g^{4}+1\neq 0 and b^{2}=g^{8}+g^{4}+1\neq 0 . Then a^{4}-b^{2}=g^{8}+2g^{4}+1-(g^{8}+g^{4}+1)=g^{4},\;\text{so},\;a^{4}-g^{4}=b^{2}. We have \phi_{q}(a^{2}g^{2})=1 and a^{2}g^{2}(a^{4}-g^{4})\neq 0 , so, (a^{2},g^{2}) is a vertex of \mathcal{J}_{\mathbb{F}_{q}} which has parents. ∎ We note that [ 9 , Theorem 3(1)] is much stronger than this result for sufficiently large q , but we have the best possible bound for q such that there is at least one nontrivial component in \mathcal{J}_{\mathbb{F}_{q}} . We can see that for smaller q , there are no nontrivial components. Further, we can be more precise than in Theorem 5.9 , and show that there is a nontrivial component consisting only of square vertices. Theorem 5.10 (Main theorem in [ 10 ] ) . Let k be a positive integer, and q>1 be a prime power. Let \delta=\gcd(q-1,k) . Assume q>(\delta-1)^{4} . Then every element of \mathbb{F}_{q} is a sum of two k th powers. Corollary 5.11 . If q\equiv 5\pmod{8} , q\geq 29 , there is a nontrivial component in \mathcal{J}_{\mathbb{F}_{q}} consisting only of square vertices. Proof. Let g be a generator of \mathbb{F}_{q}^{\times} and let q>3^{4} . We have 4=(q-1,4) and from Theorem 5.10 we find x and y such that x^{4}+y^{4}=2g^{2} . If x=\pm y , then x^{4}+y^{4}=2x^{4}=2g^{2} , then g=x^{2} or g=(ix)^{2} , which is a contradiction as g is a generator of \mathbb{F}_{q}^{\times} . So, we obtained an edge (x^{4},y^{4})\rightarrow(g^{2},x^{2}y^{2}) . Both of the vertices are squares; hence, the component consists of square vertices by Theorem 3.9 . For q=29,37,53,61 , there is at least one square component, which we can compute by computer, for example, the components that contain cycles which contain • (9,6) for q=29 ; • (27,4) for q=37 ; • (25,7) for q=53 ; • (1,9) for q=61 . ∎ Theorem 5.12 . There are \frac{(q-1)(q-5)}{2} vertices in \mathcal{J}_{\mathbb{F}_{q}} . Proof. There are \frac{q-1}{2} squares which we can pair with \frac{q-1}{2}-2=\frac{q-5}{2} squares (to avoid the pairs (a,\pm a) ). The same is true for non-squares, so together, we have \frac{(q-1)(q-5)}{2} vertices. ∎ Example 5.13 . From Theorem 5.12 , for q=5 , there are no vertices. Example 5.14 . Let q=13 . The vertices which contain 1 as the first coordinate are (1,3) , (1,4) , (1,9) and (1,10) , but none of them is part of an edge. Using symmetry and automorphisms \varphi_{\alpha} , we conclude that there are no edges in this graph. Example 5.15 . The smallest q with nontrivial graph components is q=29 . There is one cycle of length 28 and 4 cycles of length 7 . Figure 3. Components of \mathcal{J}_{\mathbb{F}_{29}} 6. Challenge for q\equiv 1\pmod{8} . It might be tempting to try to generalise our approach to q\equiv 1\pmod{8} in the following way. For q\equiv 3\pmod{4} , -1 is not a square in \mathbb{F}_{q} . If (a_{1},b_{1})\in{\mathbb{F}_{q}^{\times}}^{2} is such that \phi_{q}(a_{1}b_{1})=1 , then {\lx@inpgf@ignorespaces(a_{1},b_{1})} {\lx@inpgf@ignorespaces(a_{2},b_{2})} {\lx@inpgf@ignorespaces(a_{2},-b_{2}).} For exactly one of (a_{2},b_{2}) and (a_{2},-b_{2}) , we have \phi_{q}(\pm a_{2}b_{2})=1 , and we use this pair for the definition of the sequence. This is the definition of the AGM over such \mathbb{F}_{q} as in [ 8 ] . In this paper, we look at q\equiv 5\pmod{8} ; then -1 is a square in \mathbb{F}_{q} but i\in\mathbb{F}_{q} such that i^{2}=-1 , is not. Alternatively, the fourth root of unity is defined in \mathbb{F}_{q} , but not the eighth root of unity. We used this fact to define the AGM over such \mathbb{F}_{q} whenever possible. Namely, assume that we have two steps, as in the following diagram {\lx@inpgf@ignorespaces(a_{1},b_{1})} {\lx@inpgf@ignorespaces(a_{2},b_{2})} {\lx@inpgf@ignorespaces(a_{2},-b_{2})} {\lx@inpgf@ignorespaces(a_{3},b_{3})} {\lx@inpgf@ignorespaces(a_{3},-b_{3})} {\lx@inpgf@ignorespaces(a_{4},ib_{3})} {\lx@inpgf@ignorespaces(a_{3},-ib_{3}).} We proved that \phi_{q}(a_{3}b_{3}a_{4}ib_{3})=-1 , and then we can continue with the AGM sequence in exactly one half of the diagram. But the key point here besides \phi_{q}(i)=-1 was that \phi(a_{3}a_{4})=1 as this follows from Lemma 3.10 , as \phi_{q}(a_{4})=\phi_{q}(a_{3})=\phi_{q}(a_{1}) . Finally, let q\equiv 1\pmod{8} . Then, there is an eighth root of unity in \mathbb{F}_{q} , call it \zeta_{8} . If we furthermore assume that q\equiv 9\pmod{16} , then \phi_{q}(\zeta_{8})=-1 . We could try to look now at the first three steps of the AGM sequence: {\lx@inpgf@ignorespaces(a_{1},b_{1})} {\lx@inpgf@ignorespaces(a_{2},b_{2})} {\lx@inpgf@ignorespaces(a_{2},-b_{2})} {\lx@inpgf@ignorespaces(a_{3},b_{3})} {\lx@inpgf@ignorespaces(a_{3},-b_{3})} {\lx@inpgf@ignorespaces(a_{4},ib_{3})} {\lx@inpgf@ignorespaces(a_{3},-ib_{3})} {\lx@inpgf@ignorespaces(a_{5},b_{4})} {\lx@inpgf@ignorespaces(a_{5},-b_{4})} {\lx@inpgf@ignorespaces(a_{6},ib_{4})} {\lx@inpgf@ignorespaces(a_{6},-ib_{4})} {\lx@inpgf@ignorespaces(a_{7},b_{5})} {\lx@inpgf@ignorespaces(a_{7},-b_{5})} {\lx@inpgf@ignorespaces(a_{8},ib_{5})} {\lx@inpgf@ignorespaces(a_{8},-ib_{5}).} Here, again, if we know that we can continue for one element on the left or right half, we can continue for all of them. So, it suffices to consider pairs (a_{5},b_{4}) and (a_{7},b_{5}) . Also, by Lemma 3.10 , we have \phi_{q}(a_{5})=\phi_{q}(a_{7})=\phi_{q}(a_{2}) , so \phi_{q}(a_{5}b_{4}a_{7}b_{5})=\phi_{q}(b_{4}b_{5}) . Unlike in the previous cases, it might not be true that b_{4}b_{5} is a multiple of a square and \zeta_{8} . For q\equiv 1\pmod{16} , it is even less clear what to do up to this step. Very recently, June Kayath, Connor Lane, Ben Neifeld, Tianyu Ni, Hui Xue, published a preprint [ 9 ] in which they explain how to approach q\equiv 1\pmod{8} in a clever way using elliptic curves. They achieve exciting results which extend [ 8 , Theorem 5] about the number of components of the graphs corresponding to AGM sequences in cases q\equiv 5\pmod{8} and q\equiv 1\pmod{8} (see [ 9 , Theorem 3] ). We praise their results, and still, we leave a challenge for interested readers: Question. Is there an elementary way to prove that for sufficiently large q\equiv 1\pmod{8} , there is always a non-trivial component of the graph corresponding to the AGM sequence over \mathbb{F}_{q} ?