Does the period length $l(pq)$ of the continued fraction of $\sqrt{pq}$, for $p$ and $q$ primes, follow some type of divisibility property, say $$ l(pq) = c\frac{l(p)}{l(q)} \quad\text{or}\quad c\frac{l(q)}{l(p)}, $$ where $l(p)$ is the period of $\sqrt{p}$ and $c > 0$ is an absolute constant.

In the previous question, Franz Lemmermeyer mentioned that it depends on the squarefree kernel of the integer.

Note: The theorem on the upper bound of the length of period of continued fraction implies that $l(\ \cdot\ )$ is not multiplicative.

Thank you, Jerald Jetson.

  • $\begingroup$ It should be easy enough to check this for a few primes. Did you? $\endgroup$ Jul 22, 2010 at 0:06
  • 3
    $\begingroup$ Read the comments after Franz's answer, he revised that part of it. I will run some experiments. But bear in mind that sometimes your $l(pq)$ will be roughly the size of $l(p) \cdot l(q)$ which is consistent with some very simple bounds of Lagrange. But I bet that there are infinitely many instances of $$ p \cdot q = n^2 + 1 $$ which has about the shortest continued fraction period. That is, consider $$ \sqrt{10}, \; \sqrt{26}, \; \sqrt{65}, \; \sqrt{82}, \; \sqrt{122}, \; \sqrt{145}, \; \ldots \sqrt{901}, \; \ldots $$ where $901 = 17 \cdot 53$ was the first not divisible by 2 or 5. $\endgroup$
    – Will Jagy
    Jul 22, 2010 at 0:21
  • 2
    $\begingroup$ Let me add the remark that the left hand side of the equation in your question is invariant under switching p and q, but the right hand side is not. Thus you can't really expect it to hold. $\endgroup$ Jul 22, 2010 at 8:06
  • $\begingroup$ @Franz, "$a$ or $b$" is equivalent to "$b$ or $a$", so the way I interpret it, the right side of the equation is certainly invariant under switching $p$ and $q$. $\endgroup$ Jul 23, 2010 at 6:43
  • 1
    $\begingroup$ Ideas in this paper might be of use: math.princeton.edu/mathlab/jr02fall/Periodicity/periodmain.htm $\endgroup$ Aug 6, 2010 at 16:49

1 Answer 1


Let $p=2$, $q=5$, so $pq=10$. Then $\ell(p)=\ell(q)=\ell(pq)=1$, so if $c$ exists it must be 1. Now let $p=2$, $q=17$, so $pq=34$. Then $\ell(p)=\ell(q)=1\ne\ell(pq)$, so if $c$ exists it must not be 1. Contradiction.

EDIT: Here's a little table which, I think, shows how unlikely it is that there's any simple equation relating the period lengths of the square roots of primes $p$ and $q$ and their product. $$ \matrix{p&q&pq&\ell(p)&\ell(q)&\ell(pq)\cr2&5&10&1&1&1\cr2&17&34&1&1&4\cr2&13&26&1&5&1\cr2&7&14&1&4&4\cr13&89&1157&5&5&1\cr} $$

So, if $\ell(p)$ and $\ell(q)$ are both 1 then $\ell(pq)$ may or may not be 1; if $\ell(p)$ and $\ell(pq)$ are both 1 then $\ell(q)$ may or may not be 1; if $\ell(p)$ is 1 and $\ell(pq)$ is not 1 then $\ell(q)$ may or may not be 1; if $\ell(pq)$ is 1 and $\ell(q)$ is not 1 then $\ell(p)$ may or may not be 1.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.