Assume m and n are both integers in the range [ 1 , 1 0 0 0 0 ] such that n m is the closest possible value to Euler's constant e ( about 2 . 7 1 8 2 8 1 8 2 8 ) and is a simplified fraction.
What is m + n ?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Nice! That program seems much more efficient than mine (mine took 5-10 seconds).
A key selection of successive convergents of the continued fraction expansion of e are 5 3 6 1 4 5 7 , 1 0 0 1 2 7 2 1 and 8 5 4 4 2 3 2 2 5 . The last one gives too large a value of m , so we want 2 7 2 1 + 1 0 0 1 = 3 7 2 2 .
Again, no easy way to solve this program. Below is a Python 3.4 program (it literally tries all possible values of
m
and
n
) which can be used to solve the problem efficiently.
If we look at all of the contents in the list of fractions, we find the closest value possible is
2
.
7
1
8
2
8
1
7
1
8
2
8
1
7
1
8
3
, with the smallest possible values
m
=
2
7
2
1
and
n
=
1
0
0
1
.
Note: Not all of the contents in the list are shown.
Problem Loading...
Note Loading...
Set Loading...
Here is how you find successive convergents in M a t h e m a t i c a
Convergents[E,15]
returns 15 convergents:
2 , 3 , 3 8 , 4 1 1 , 7 1 9 , 3 2 8 7 , 3 9 1 0 6 , 7 1 1 9 3 , 4 6 5 1 2 6 4 , 5 3 6 1 4 5 7 , 1 0 0 1 2 7 2 1 , 8 5 4 4 2 3 2 2 5 , 9 5 4 5 2 5 9 4 6 , 1 8 0 8 9 4 9 1 7 1 , 1 9 0 4 3 5 5 1 7 6 5 6
here is the program that answers the question
Numerator@#+Denominator@#&@Last@Select[Convergents[E,20],Numerator@#<10000&]
returns 3 7 2 2 .