cp's OEIS Frontend

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.

Showing 1-4 of 4 results.

A337211 Numbers k such that b(k) < b(j) for all j < k where b(k) = Min_{sqrt(n) - Sum_{i} sqrt(c_i) > 0 with c_i being unique integers}.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 10, 12, 14, 15, 18, 21, 22, 24, 26, 29, 34, 35, 38, 40, 42, 46, 47, 79, 89, 184, 226, 264, 269, 299, 419, 426, 505, 545
Offset: 1

Views

Author

Robert G. Wilson v, Aug 19 2020

Keywords

Comments

This sequence is the original definition of A045880.

Examples

			a(1) is 1 since sqrt(1) - sqrt(0)                            = 1.00000 ... ;
a(2) is 2 since sqrt(2) - sqrt(1)                            = 0.41421 ...  which is an improvement over a(0);
a(3) is 3 since sqrt(3) - sqrt(2)                            = 0.31783 ... ;
a(4) is 4 since sqrt(4) - sqrt(3)                            = 0.26794 ... ;
a(5) is 5 since sqrt(5) - sqrt(4)                            = 0.23606 ... ;
a(6) is 6 since sqrt(6) - (sqrt(1) + sqrt(2))                = 0.03527 ... ;
7 is not in the sequence since sqrt(7) -  sqrt(6)            = 0.19626 ... which is not an improvement of a(5);
8 is not in the sequence since sqrt(8) - (sqrt(1) + sqrt(3)) = 0.09637 ... which again is not an improvement over a(5);
9 is not in the sequence since sqrt(9) - sqrt(8)             = 0.17157 ... which is not an improvement of a(5);
a(7) is 10 because sqrt(10) - (sqrt(2) + sqrt(3))            = 0.01601 ... ;
a(8) is 12 because sqrt(12) - (sqrt(1) + sqrt(6))            = 0.01461 ... ; etc.
		

Crossrefs

Extensions

a(24) corrected by Jinyuan Wang, Aug 23 2020
Title improved, a(26) corrected and a(31)-a(34) from Sean A. Irvine, Mar 23 2021

A337210 Irregular triangle read by rows in which row n has the least number of integers such that the sum of the square root of those integers is the best approximation to and less than the square root of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 1, 2, 6, 1, 3, 8, 2, 3, 1, 5, 1, 6, 12, 3, 4, 2, 6, 3, 5, 2, 7, 4, 5, 1, 11, 1, 12, 2, 10, 5, 6, 1, 14, 3, 10, 1, 3, 5, 6, 7, 1, 3, 6, 2, 15, 2, 3, 5, 7, 8, 1, 3, 8, 2, 4, 5, 4, 14, 8, 9, 6, 12, 2, 21, 1, 5, 8, 9, 10, 4, 18, 6, 15, 1, 5, 10, 10
Offset: 1

Views

Author

Robert G. Wilson v, Aug 19 2020

Keywords

Comments

All approximations are less than or equal to one. An approximation sqrt(n) - sqrt(n-1) < 1 for all n > 1.
Often integers of the form 4n-2 have as their best approximation just the two consecutive integers {n-1, n}.
Those that are not: 20, 21, 25, 27, 30, 31, 36, 37, 38, 40, 42, 44, 45, 46, 47, 48, 49, 52, ... .
Sometimes two approximations are equal, i.e.; for n = 39, sqrt(2) + sqrt(4) + sqrt(8) is the same as sqrt(4) + sqrt(18). In this sequence the simplest form is used, i.e.; {4, 18}.

Examples

			For row 1, just the sqrt(0) < sqrt(1);
for row 2, just the sqrt(1) < sqrt(2);
for row 3, just the sqrt(2) < sqrt(3);
for row 4, just the sqrt(3) < sqrt(4);
for row 5, just the sqrt(4) < sqrt(5);
for row 6, sqrt(1) + sqrt(2) < sqrt(6);
for row 7, just the sqrt(6) < sqrt(7);
for row 8, sqrt(1) + sqrt(3) < sqrt(8);
for row 9, just the sqrt(8) < sqrt(9);
for row 10, sqrt(2) + sqrt(3) is the best approximation;
for row 11, sqrt(1) + sqrt(5) < sqrt(11);
for row 12, sqrt(1) + sqrt(6) < sqrt(12);
for row 27, sqrt(1) + sqrt(3) + sqrt(6) is the best approximation;
for row 63, 2*sqrt(3) + 2*sqrt(5) is the best approximation and appears as the integers {12, 20};
for row 107, sqrt(3) + sqrt(6) + sqrt(9) + sqrt(10) is the best approximation;
for row 165, sqrt(1) + 2*sqrt(2) + 2*sqrt(3) + sqrt(5) + sqrt(11) is the best approximation and appears as the integers {1, 5, 8, 11, 12};
for row 218, sqrt(1) + sqrt(3) + sqrt(5) + sqrt(6) + sqrt(13) + sqrt(14) is the best approximation; etc.
Triangle begins:
0;
1;
2;
3;
4;
1, 2;
6;
1, 3;
8;
2, 3;
...
		

Crossrefs

Inspired by A045880.
Cf. A337211.

Programs

  • Mathematica
    y[x_] := Block[{lst = {x - 1}, min = Sqrt[x] - Sqrt[x - 1], rad = 1, sx = Sqrt[x]},
      If[x > 5, lim = (sx - 1)^2;
       Do[diff = sx - (Sqrt[a] + Sqrt[b]);
        If[diff < min && diff > 0, min = diff; lst = {b, a}; rad = 2],
        {a, 2, lim}, {b, 1, a - 1}]];
      If[x > 17, lim = (sx - Sum[Sqrt[z], {z, 2}])^2;
       Do[diff = sx - (Sqrt[a] + Sqrt[b] + Sqrt[c]);
        If[diff < 0, Continue[]];
        If[diff < min && diff > 0, min = diff; lst = {c, b, a}; rad = 3],
        {a, 3, lim}, {b, 2, a - 1}, {c, 1, b - 1}]];
      If[x > 37, lim = (sx - Sum[Sqrt[z], {z, 3}])^2;
       Do[diff = sx - (Sqrt[a] + Sqrt[b] + Sqrt[c] + Sqrt[d]);
        If[diff < 0, Continue[]];
        If[diff < min && diff > 0, min = diff; lst = {d, c, b, a};
         rad = 4],
        {a, 4, lim}, {b, 3, a - 1}, {c, 2, b - 1}, {d, 1, c - 1}]];
      If[x > 71, lim = (sx - Sum[Sqrt[z], {z, 4}])^2;
       Do[diff = sx - (Sqrt[a] + Sqrt[b] + Sqrt[c] + Sqrt[d] + Sqrt[e]);
        If[diff < 0, Continue[]];
        If[diff < min && diff > 0, min = diff; lst = {e, d, c, b, a};
         rad = 5],
        {a, 5, lim}, {b, 4, a - 1}, {c, 3, b - 1}, {d, 2, c - 1}, {e, 1,
         d - 1}]];
      If[x > 117, lim = (sx - Sum[Sqrt[z], {z, 5}])^2;
       Do[diff =
         sx - (Sqrt[a] + Sqrt[b] + Sqrt[c] + Sqrt[d] + Sqrt[e] + Sqrt[f]);
         If[diff < 0, Continue[]];
        If[diff < min && diff > 0, min = diff; lst = {f, e, d, c, b, a};
         rad = 6],
        {a, 6, lim}, {b, 5, a - 1}, {c, 4, b - 1}, {d, 3, c - 1}, {e, 2,
         d - 1}, {f, 1, e - 1}]];
      If[x > 181, lim = (sx - Sum[Sqrt[z], {z, 6}])^2;
       Do[diff =
         sx - (Sqrt[a] + Sqrt[b] + Sqrt[c] + Sqrt[d] + Sqrt[e] + Sqrt[f] +
             Sqrt[g]); If[diff < 0, Continue[]];
        If[diff < min && diff > 0, min = diff;
         lst = {g, f, e, d, c, b, a}; rad = 7],
        {a, 7, lim}, {b, 6, a - 1}, {c, 5, b - 1}, {d, 4, c - 1}, {e, 3,
         d - 1}, {f, 2, e - 1}, {g, 1, f - 1}]];
      If[x > 265, lim = (sx - Sum[Sqrt[z], {z, 7}])^2;
       Do[diff =
         sx - (Sqrt[a] + Sqrt[b] + Sqrt[c] + Sqrt[d] + Sqrt[e] + Sqrt[f] +
             Sqrt[g] + Sqrt[h]); If[diff < 0, Continue[]];
        If[diff < min && diff > 0, min = diff;
         lst = {g, f, e, d, c, b, a}; rad = 8],
        {a, 8, lim}, {b, 7, a - 1}, {c, 6, b - 1}, {d, 5, c - 1}, {e, 4,
         d - 1}, {f, 3, e - 1}, {g, 2, f - 1}, {h, 1, g - 1}]];
     lst];
     Array[ y, 50] // Flatten

Formula

s = sum(sqrt(i)) for carefully chosen integers i less than n such that s < n yet is the best approximation to n.

A333987 Integers m for which b(m) < b(m-1) where b(k) = Min_{sqrt(k) - sqrt(x) - sqrt(y) > 0 with x, y distinct integers}.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 10, 12, 14, 15, 18, 21, 22, 24, 26, 30, 33, 34, 35, 38, 40, 42, 46, 50, 54, 58, 60, 62, 63, 65, 66, 70, 74, 78, 82, 84, 85, 86, 90, 94, 98, 99, 102, 106, 110, 112, 114, 118, 122, 126, 130, 133, 134, 138, 142, 143, 144, 146, 150, 154, 158, 161
Offset: 1

Views

Author

Jinyuan Wang and Robert G. Wilson v, Sep 04 2020

Keywords

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).

Crossrefs

Programs

  • 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
  • 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)));

A336112 a(n) is the least number k such that the Sum_{i=0..k} sqrt(k) equals or exceeds n.

Original entry on oeis.org

0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23
Offset: 0

Views

Author

Robert G. Wilson v, Jul 08 2020

Keywords

Comments

Inspired by A045880.
Let c = (9/4)^(1/3) = (3/2)^(2/3) ~ 1.310370697..., then a(n) ~ c*n^(2/3).
a(10^k) for k>= 0: 1, 6, 28, 131, 608, 2823, 13104, 60822, 282311, 1310371, 6082202, 28231081, 131037070, 608220200, ..., .

Examples

			a(0) = 0 since the sqrt(0) = 0;
a(1) = 1 since the sqrt(0) + sqrt(1) = 1;
a(2) = 2 since the sqrt(0) + sqrt(1) + sqrt(2) ~ 2.41421... which exceeds 2;
a(3) = 3 since the sqrt(0) + sqrt(1) + sqrt(2) + sqrt(3) ~ 4.146264... which easily exceeds 3;
a(4) = 3 because the sqrt(0) + sqrt(1) + sqrt(2) + sqrt(3) ~ 4.146264... which barely exceeds 4; etc.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = s = 0}, While[s < n, k++; s = s + Sqrt@k]; k]; Array[f, 75, 0]
  • PARI
    a(n) = my(s=0, k=0); while ((s+=sqrt(k)) < n, k++); k; \\ Michel Marcus, Jul 09 2020

Formula

a(k*n) ~ k^(2/3)*a(n).
Showing 1-4 of 4 results.