# How do you proof that the simply periodic continuous fraction is palindromic for the square root of positive primes?

I have formulated this question based on the initial curiosity and further investigation of the topic posted here: Identity and possible generalization of the reflective periodic continued fractions

How do you proof that for the square root of any positive prime, the simply periodic continuous fraction is palindromic?

It should be true both for even:

$$\sqrt{Z^+_{prime}} = [a_0; a_1, a_2, ..., a_2, a_1, 2a_0]$$

and for odd:

$$\sqrt{Z^+_{prime}} = [a_0; a_1, ..., a_n, ..., a_1, 2a_0]$$

sequences.

• It's no easier to prove it for primes than to prove it for positive nonsquare integers generally, but it is a bit long. Better to get yourself a good intro Number Theory text, many of them include the proof. – Gerry Myerson May 20 '17 at 12:52
• I found many papers talking about the symmetry of the conjugate of the quadratic surd. But I didn't find any of them dealing with palindromic part exactly. I'd appreciate any reference that deals with the exact palindromic case I'm pointing. Of cource handling primes is not required, I thought it could narrow the problem but maybe it doesn't but rather complicates the proof... – MarkokraM May 20 '17 at 13:01
• Have you tracked down any of the references in my answer? – Gerry Myerson May 23 '17 at 12:42
• Yes. I found Roberts and Stark and got some ideas. Still trying to find other three sources if they are available online. I'll be back after doing some work with given exercises. – MarkokraM May 23 '17 at 14:04
• Also Rosen, "Elementary Number Theory" (10.4, pages 387-388) was online. So far it has the exact point made toward palindromic part and double ending of the sequence. It just needs to be modified a bit to fit to my question. – MarkokraM May 24 '17 at 3:56

## 1 Answer

Here are five textbooks that deal with the palindromic feature of the continued fraction expansion of $\sqrt n$. Some give detailed proofs, some give it as an exercise with strong hints. All require reading some of the material leading up to the problem. There's just no really easy way – you have to roll your sleeves up and get to work!

1. Rosen, Elementary Number Theory, 4th edition, Section 12.4.

2. Roberts, Elementary Number Theory, Chapter XIII, problem 17, part vi (book includes complete solutions to all problems).

3. Shanks, Solved and Unsolved Problems in Number Theory, Exercise 138, page 186.

4. Steuding, Diophantine Analysis, Section 5.4.

5. Stark, An Introduction to Number Theory, Chapter 7, Miscellaneous Exercise 18.