This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A265777 #10 Apr 05 2019 17:45:45 %S A265777 2,2,5,29,691,773,971,1009,2617,6079,15731,27073,37879,43789,55609 %N A265777 Denominators of primes-only best approximates (POBAs) to sqrt(2); see Comments. %C A265777 Suppose that x > 0. A fraction p/q of primes is a primes-only best approximate (POBA), and we write "p/q in B(x)", if 0 < |x - p/q| < |x - u/v| for all primes u and v such that v < q, and also, |x - p/q| < |x - p'/q| for every prime p' except p. Note that for some choices of x, there are values of q for which there are two POBAs. In these cases, the greater is placed first; e.g., B(3) = (7/2, 5/2, 17/5, 13/5, 23/7, 19/7, ...). See A265759 for a guide to related sequences. %e A265777 The POBAs to sqrt(2) start with 2/2, 3/2, 7/5, 41/29, 977/691, 1093/773, 1373/971, 1427/1009. For example, if p and q are primes and q > 29, then 41/29 is closer to sqrt(2) than p/q is. %t A265777 x = Sqrt[2]; z = 800; p[k_] := p[k] = Prime[k]; %t A265777 t = Table[Max[Table[NextPrime[x*p[k], -1]/p[k], {k, 1, n}]], {n, 1, z}]; %t A265777 d = DeleteDuplicates[t]; tL = Select[d, # > 0 &] (* lower POBA *) %t A265777 t = Table[Min[Table[NextPrime[x*p[k]]/p[k], {k, 1, n}]], {n, 1, z}]; %t A265777 d = DeleteDuplicates[t]; tU = Select[d, # > 0 &] (* upper POBA *) %t A265777 v = Sort[Union[tL, tU], Abs[#1 - x] > Abs[#2 - x] &]; %t A265777 b = Denominator[v]; s = Select[Range[Length[b]], b[[#]] == Min[Drop[b, # - 1]] &]; %t A265777 y = Table[v[[s[[n]]]], {n, 1, Length[s]}] (* POBA, A265776/A265777 *) %t A265777 Numerator[tL] (* A265772 *) %t A265777 Denominator[tL] (* A265773 *) %t A265777 Numerator[tU] (* A265774 *) %t A265777 Denominator[tU] (* A265775 *) %t A265777 Numerator[y] (* A265776 *) %t A265777 Denominator[y] (* A265777 *) %Y A265777 Cf. A000040, A265759, A265772, A265773, A265774, A265775, A265776. %K A265777 nonn,frac,more %O A265777 1,1 %A A265777 _Clark Kimberling_, Dec 20 2015 %E A265777 a(11)-a(15) from _Robert Price_, Apr 05 2019