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-2 of 2 results.

A116884 Integers k such that 0 < |k^5 - m^2| <= k^(3/2) for some integer m.

Original entry on oeis.org

1, 5, 8, 23, 27, 55, 73, 76, 377, 396, 432, 18219, 18231, 747343, 748635, 5523608, 7626590, 32866452, 82251007, 1133553044, 1778903359, 3664408636, 7208605769, 26149894782
Offset: 1

Views

Author

Giovanni Resta, Feb 27 2006

Keywords

Examples

			|432^5 - 3878907^2| = 8217 < 432^(3/2).
		

Crossrefs

A253181 Numbers n such that the distance between n^3 and the nearest square is less than n.

Original entry on oeis.org

1, 2, 3, 4, 5, 9, 13, 15, 16, 17, 25, 32, 35, 36, 37, 40, 43, 46, 49, 52, 56, 63, 64, 65, 81, 99, 100, 101, 109, 121, 136, 143, 144, 145, 152, 158, 169, 175, 190, 195, 196, 197, 225, 243, 255, 256, 257, 289, 312, 317, 323, 324, 325, 331, 336, 351, 356, 361, 366, 377
Offset: 1

Views

Author

Alex Ratushnyak, Mar 23 2015

Keywords

Comments

Distance can be zero, that is, cubes that are squares are included.
Numbers n such that A002938(n) < n.

Examples

			The distance between 5^3=125 and the nearest square 11^2=121 is less than 5, so 5 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    dnsQ[n_]:=Module[{n3=n^3,sr},sr=Sqrt[n3];Min[n3-Floor[sr]^2, Ceiling[ sr]^2- n3]Harvey P. Dale, Dec 23 2015 *)
  • Python
    def isqrt(a):
        sr = 1 << (int.bit_length(int(a)) >> 1)
        while a < sr*sr:  sr>>=1
        b = sr>>1
        while b:
            s = sr + b
            if a >= s*s:  sr = s
            b>>=1
        return sr
    for n in range(1000):
        cube = n*n*n
        r = isqrt(cube)
        sqr = r**2
        if cube-sqr < n or sqr+2*r+1-cube < n:  print(str(n), end=',')
Showing 1-2 of 2 results.