PROJECT EULER · #0064
Odd Period Square Roots
All square roots are periodic when written as continued fractions and can be written in the form:
For example, let us consider
If we continue we would get the following expansion:
The process can be summarised as follows:
It can be seen that the sequence is repeating. For conciseness, we use the notation
The first ten continued fraction representations of (irrational) square roots are:
Exactly four continued fractions, for
How many continued fractions for
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.