#57 Square Root Convergents - Project Euler (original) (raw)
Published on Friday, 21st November 2003, 06:00 pm; Solved by 46064;
Difficulty rating: 5%
It is possible to show that the square root of two can be expressed as an infinite continued fraction. sqrt2=1+frac12+frac12+frac12+dots\sqrt 2 =1+ \frac 1 {2+ \frac 1 {2 +\frac 1 {2+ \dots}}}sqrt2=1+frac12+frac12+frac12+dots
By expanding this for the first four iterations, we get: 1+frac12=frac32=1.51 + \frac 1 2 = \frac 32 = 1.51+frac12=frac32=1.5 1+frac12+frac12=frac75=1.41 + \frac 1 {2 + \frac 1 2} = \frac 7 5 = 1.41+frac12+frac12=frac75=1.4 1+frac12+frac12+frac12=frac1712=1.41666dots1 + \frac 1 {2 + \frac 1 {2+\frac 1 2}} = \frac {17}{12} = 1.41666 \dots1+frac12+frac12+frac12=frac1712=1.41666dots 1+frac12+frac12+frac12+frac12=frac4129=1.41379dots1 + \frac 1 {2 + \frac 1 {2+\frac 1 {2+\frac 1 2}}} = \frac {41}{29} = 1.41379 \dots1+frac12+frac12+frac12+frac12=frac4129=1.41379dots
The next three expansions are frac9970\frac {99}{70}frac9970, frac239169\frac {239}{169}frac239169, and frac577408\frac {577}{408}frac577408, but the eighth expansion, frac1393985\frac {1393}{985}frac1393985, is the first example where the number of digits in the numerator exceeds the number of digits in the denominator.
In the first one-thousand expansions, how many fractions contain a numerator with more digits than the denominator?