MATLAB code:
a=3/2; n=1;
while a<2020
a=1+n/a;
n=n+1;
if n<20 || a>2019.998
disp([n a])
end
end
disp ([n a]);
finds
The first few
n a(n)
2 1.66666666666667
3 2.2
4 2.36363636363636
5 2.69230769230769
6 2.85714285714286
7 3.1
8 3.25806451612903
9 3.45544554455446
10 3.60458452722063
11 3.77424483306836
12 3.91449031171019
13 4.06553319703002
14 4.19761255657606
15 4.33522920739013
16 4.46002466822976
17 4.58742410416994
18 4.70578337951076
19 4.82508044853339
. . .
and the leadup to the answer:
4078373 2019.99814307323
4078374 2019.99839065948
4078375 2019.9986382457
4078376 2019.99888583189
4078377 2019.99913341805
4078378 2019.99938100417
4078379 2019.99962859027
4078380 2019.99987617634
4078381 2020.00012376237
making the answer
n = 4078381 a(n) = 2020.00012376237
UBASIC's
10 a=3/2: n=1
20 while a<2020
30 a=1+n/a
40 n=n+1
50 wend
60 print n,a
corroborates the answer with slightly greater precision, 2020.0001237623724490723, but much longer time, for n = 4078381.
|
Posted by Charlie
on 2020-10-28 10:52:22 |