OFFSET
1,3
COMMENTS
"Next smallest" means that a(2n-1)+a(2n) is the smallest value that is greater than the previous pair.
EXAMPLE
abs(1/1-sqrt(2)) > abs(3/2-sqrt(2)) > abs(4/3-sqrt(2)) > abs(7/5-sqrt(2)) > abs(17/12-sqrt(2)) > ... > 0.
MATHEMATICA
AproximaRaiz2Vector[it_] := (
error = 1;
itactual = 0;
d = 1;
Lista = {};
While[itactual < it,
n = Floor[Sqrt[2]*d];
erroract = Abs[n/d - Sqrt[2]];
If[erroract < error, error = erroract; itactual++;
Print[n, "/", d, " = ", n/d + .0, " - E: ",
Abs[n/d - Sqrt[2]] + .0]; Lista = Append[Lista, n];
Lista = Append[Lista, d]];
n++;
erroract = Abs[n/d - Sqrt[2]];
If[erroract < error, error = erroract; itactual++;
Print[n, "/", d, " = ", n/d + .0, " - E: ",
Abs[n/d - Sqrt[2]] + .0]; Lista = Append[Lista, n];
Lista = Append[Lista, d]];
d++;
];
Lista
); (* Maximiliano Alba, Jan 19 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Bodo Zinser, Nov 22 2001
EXTENSIONS
Corrected and extended by Maximiliano Alba, Jan 19 2021
STATUS
approved