Skip to content

Commit

Permalink
[euler] pod formating
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoss committed May 19, 2015
1 parent ed9570f commit 889bd65
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 29 deletions.
42 changes: 21 additions & 21 deletions categories/euler/prob065-andreoss.pl
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,33 @@
The square root of 2 can be written as an infinite continued fraction.
√2 = 1 + 1
______
2 + 1
______
2 + 1
______
2 + 1
______
2 + ...
√2 = 1 + 1
______
2 + 1
______
2 + 1
______
2 + 1
______
2 + ...
The infinite continued fraction can be written, √2 = [1;(2)], (2) indicates
that 2 repeats ad infinitum. In a similar way, √23 = [4;(1,3,1,8)].
It turns out that the sequence of partial values of continued fractions for
square roots provide the best rational approximations. Let us consider the
convergents for √2.
1 + 1
___ = 3/2
2
1 + 1
_________ = 7/5
2 + 1 / 2
....
1 + 1
___ = 3/2
2
1 + 1
_________ = 7/5
2 + 1 / 2
....
Hence the sequence of the first ten convergents for √2 are: 1, 3/2, 7/5,
17/12, 41/29, 99/70, 239/169, 577/408, 1393/985, 3363/2378, ...
Expand Down
18 changes: 10 additions & 8 deletions categories/euler/prob066-andreoss.pl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
L<https://projecteuler.net/problem=66>
Consider quadratic Diophantine equations of the form:
x² – D×y² = 1
Consider quadratic Diophantine equations of the form: x² – D×y² = 1
For example, when D=13, the minimal solution in x is 649² – 13×180² = 1.
Expand All @@ -20,12 +18,16 @@
By finding minimal solutions in x for D = {2, 3, 5, 6, 7}, we obtain the
following:
3²– 2×2²= 1
2²– 3×1²= 1
9²– 5×4²= 1
5²– 6×2²= 1
8²– 7×3²= 1
3² – 2×2²= 1
2² – 3×1²= 1
9² – 5×4²= 1
5² – 6×2²= 1
8² – 7×3²= 1
Hence, by considering minimal solutions in x for D ≤ 7, the largest x is
obtained when D=5.
Expand Down

0 comments on commit 889bd65

Please sign in to comment.