Chapter 14 - Continued Fraction Expansions of Quadratic Irrationals
Example 14.11
[2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1]
Example 14.14 - Fermat Factoring
124
125
5*sqrt(5)
11.1803398874989
374
sqrt(374)
19.3390796058137
625
25
15251
Example 14.17 - Continued Fraction Factorization
[0, 1, 566, 566]
[566, 457, 2, 1133]
[348, 437, 2, 2832]
The function defined below will compute values of Pn, Qn, and an as defined in Lemma 14.6 and outputs values of pn (mod d) and the factorization of (-1)n-1Qn+1
n p_n (-1)^(n-1) Q_(n+1)
+----+--------+--------------------+
0 566 -1 * 457
1 1133 19 * 23
2 2832 -1 * 101
3 29453 857
4 32285 -1 * 2^2 * 53
5 158593 449
6 28658 -1 * 2^2 * 79
7 244567 11 * 13
8 136562 -1 * 659
9 60316 2^2 * 109
10 196878 -1 * 19 * 31
11 257194 353
12 69640 -1 * 521
13 6021 2^2 * 11 * 13
14 75661 -1 * 251
15 233004 839