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.

A238489 Numbers k such that k+x+y is a square, where x and y are the two squares nearest to k.

Original entry on oeis.org

0, 4, 11, 23, 56, 80, 103, 135, 204, 248, 339, 395, 444, 508, 576, 635, 711, 860, 948, 1119, 1219, 1304, 1412, 1619, 1739, 1968, 2100, 2211, 2351, 2495, 2616, 2768, 3055, 3219, 3528, 3704, 3851, 4035, 4223, 4380, 4576, 4943, 5151, 5540, 5760, 5943, 6171, 6596, 6836, 7283
Offset: 1

Views

Author

Alex Ratushnyak, Feb 27 2014

Keywords

Comments

If k is a square then y=k.
The sequence of terms that are perfect squares begins: 0, 4, 576, 108900, 21086464, 4090114116, 793453377600.
In other words, numbers x such that x + 2y(y+1) = z^2 has a solution with x in the interval [y^2+1, (y+1)^2], see Sage program. - Ralf Stephan, Mar 09 2014
The nonzero terms which are perfect squares are exactly the squares of A081065. - Ivan Neretin, Jun 25 2015

Examples

			The two squares nearest to 4 are 1 and 4. Because 4+1+4=9 is a square, 4 is in the sequence.
The two squares nearest to 11 are 9 and 16. Because 11+9+16=36 is a square, 11 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    kxyQ[n_]:=Module[{c=Floor[Sqrt[n]]},IntegerQ[Sqrt[n+Total[Nearest[Range[c-2, c+2]^2,n,2]]]]]; Join[{0},Select[Range[3,7500],kxyQ]] (* Harvey P. Dale, Apr 24 2022 *)
  • Python
    # use version >= 3.8
    from math import isqrt
    for k in range(7777):
        s = isqrt(k)
        if s*s==k:  s-=1
        kxy = k + 2*s*(s+1) + 1   # k + s^2 + (s+1)^2
        r = isqrt(kxy)
        if r*r==kxy:  print(str(k), end=',')
    
  • Sage
    def gen_a():
        n = 1
        while True:
            for t in range(n*n + 1, n*n + 2*n + 2):
                if is_square(t + 2*(n*n + n) + 1):
                    yield t
        n += 1              # Ralf Stephan, Mar 09 2014

A269569 Numbers k such that k+s+c is a square, where s is the nearest square to k and c is the nearest cube to k.

Original entry on oeis.org

0, 2, 4, 8, 29, 37, 45, 56, 68, 80, 92, 99, 115, 235, 257, 279, 413, 593, 751, 791, 831, 909, 955, 1001, 1396, 1450, 1504, 1572, 1961, 2019, 2087, 2500, 2576, 3093, 3634, 3720, 4129, 4223, 4317, 4522, 4624, 4726, 5816, 5928, 6040, 7110, 7232, 7354, 7535, 7665, 8368, 8500
Offset: 1

Views

Author

Alex Ratushnyak, Feb 29 2016

Keywords

Examples

			The square nearest to 8 is 9, the cube nearest to 8 is 8. Because 8+8+9 is a square, 8 is in the sequence.
The square nearest to 29 is 25, the cube nearest to 29 is 27. Because 29+25+27 is a square, 29 is in the sequence.
		

Crossrefs

Showing 1-2 of 2 results.