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.

A232176 Least positive k such that n^2 + triangular(k) is a square.

Original entry on oeis.org

1, 2, 6, 10, 14, 18, 7, 5, 8, 34, 6, 42, 46, 15, 54, 16, 14, 66, 70, 74, 23, 82, 9, 90, 17, 98, 102, 10, 110, 15, 25, 122, 126, 16, 39, 48, 40, 21, 150, 34, 158, 29, 54, 48, 30, 13, 182, 63, 55, 194, 56, 202, 14, 45, 214, 63, 222, 26, 41, 234, 31, 42, 39, 250, 32, 63
Offset: 0

Views

Author

Alex Ratushnyak, Nov 19 2013

Keywords

Comments

Triangular(k) = A000217(k) = k*(k+1)/2.
a(n) <= 4*n - 2, because with k = 4*n-2: n^2 + k*(k+1)/2 = n^2 + (4*n-2)*(4*n-1)/2 = 9*n^2 - 6*n + 1 = (3*n-1)^2.
The sequence of numbers n such that a(n)=n begins: 8, 800, 7683200 ... - a subsequence of A220186.

Crossrefs

Cf. A232179 (least k>=0 such that n^2 + triangular(k) is a triangular number).
Cf. A101157 (least k>0 such that triangular(n) + k^2 is a triangular number).
Cf. A232178 (least k>=0 such that triangular(n) + k^2 is a square).

Programs

  • Mathematica
    lpk[n_]:=Module[{k=1},While[!IntegerQ[Sqrt[n^2+(k(k+1))/2]],k++];k]; Array[ lpk,70,0] (* Harvey P. Dale, May 04 2018 *)
  • PARI
    a(n) = {k = 1; while (! issquare(n^2 + k*(k+1)/2), k++); k;} \\ Michel Marcus, Nov 20 2013
  • Python
    import math
    for n in range(77):
      n2 = n*n
      y=1
      for k in range(1,10000001):
        sum = n2 + k*(k+1)//2
        r = int(math.sqrt(sum))
        if r*r == sum:
          print(str(k), end=',')
          y=0
          break
      if y: print('-', end=',')
    

A232267 Least k>=0 such that n^3 + k^2 is a square.

Original entry on oeis.org

0, 0, 1, 3, 0, 10, 3, 21, 8, 0, 15, 55, 6, 78, 35, 15, 0, 136, 27, 171, 10, 42, 99, 253, 10, 0, 143, 81, 42, 406, 15, 465, 64, 88, 255, 35, 0, 666, 323, 91, 3, 820, 21, 903, 55, 66, 483, 1081, 48, 0, 125, 85, 39, 1378, 81, 165, 28, 76, 783, 1711, 15, 1830, 899, 63
Offset: 0

Views

Author

Alex Ratushnyak, Nov 21 2013

Keywords

Crossrefs

Programs

  • Mathematica
    Table[k = 0; While[! IntegerQ[Sqrt[n^3 + k^2]], k++]; k, {n, 0, 100}] (* T. D. Noe, Nov 22 2013 *)
Showing 1-2 of 2 results.