OFFSET
1,2
COMMENTS
b(a(n)) is a closer approximation than b(a(n-1)), where b(k) is the "best approximation" to k using only two radicals as defined in A337210.
Except for the first five terms, all terms present require two positive radicals.
Numbers of the form 4k - 2 for k > 0 are always in the sequence with arguments of their two radicals being k - 1 and k.
4, 12, 24, 40, 60, 84, 112, 144, 180, ... are terms == 0 (mod 4); 1, 5, 21, 33, 65, 85, 133, 161, 225, ... are terms == 1 (mod 4); 3, 15, 35, 63, 99, 143, 195, 255, 323, ... are terms == 3 (mod 4).
MATHEMATICA
y[x_] := Block[{lst = {x - 1}, min = Sqrt[x] - Sqrt[x - 1], rad = 1, sx = Sqrt[x]}, If[x > 5, a = 2; lim = (sx - 1)^2; While[a <= lim, b = 1; While[b < a, diff = sx - (Sqrt[a] + Sqrt[b]); If[ diff < 0, Break[]]; If[diff < min && diff > 0, rad = 2; min = diff; lst = {b, a}]; b++]; a++]]; min]; k = 1; min = Infinity; lst = {}; While[k < 171, a = y@k; If[a < min, min = a; AppendTo[lst, k]]; k++]; lst
PROG
(PARI) b(k) = {my(m=s=sqrt(k), t); for(x=1, k\4, if((t=(t=s-sqrt(x))-sqrt(floor(t^2))) < m && t > 10^-20, m=t)); m; }
lista(nn) = my(r=1); for(k=1, 4, print1(k, ", ")); for(k=1, nn, if(b(k) < r, print1(k, ", "); r=b(k)));
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jinyuan Wang and Robert G. Wilson v, Sep 04 2020
STATUS
approved