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.

A347594 a(0) = 1; for n>0, a(n) is the smallest positive integer such that a(n-1)^2 + n^2 + a(n) is a square.

Original entry on oeis.org

1, 2, 1, 6, 12, 27, 19, 31, 64, 48, 96, 72, 1, 26, 28, 15, 3, 26, 24, 24, 48, 64, 44, 35, 48, 96, 108, 151, 131, 223, 447, 831, 639, 190, 380, 299, 507, 663, 1212, 904, 209, 7, 36, 104, 17, 87, 116, 211, 264, 264, 165, 103, 143, 151, 204, 303, 536, 1055, 860, 1688, 3156, 2592, 1341, 1399
Offset: 0

Views

Author

Scott R. Shannon, Sep 08 2021

Keywords

Comments

In the first one million terms the largest value is a(987016) = 123592518669. In this range the smallest number that has not yet appeared is 9.

Examples

			a(1) = 2 as a(0)^2 + 1^2 = 1 + 1 = 2, and 2 + 2 = 4 = 2^2 is the next smallest square.
a(2) = 1 as a(1)^2 + 2^2 = 4 + 4 = 8, and 8 + 1 = 9 = 3^2 is the next smallest square.
a(60) = 3156 as a(59)^2 + 60^2 = 2849344 + 3600 = 2852944, and 2852944 + 3156 = 2856100 = 1690^2 is the next smallest square.
		

Crossrefs

Programs

  • Mathematica
    Nest[Append[#, Block[{k = 1, m = Last[#1]}, While[! IntegerQ@ Sqrt[#2^2 + m^2 + k], k++]; k]] & @@ {#, Length@ #} &, {1}, 63] (* Michael De Vlieger, Sep 08 2021 *)
  • PARI
    lista(nn) = {my(prec = 1, list=List()); listput(list, prec); for (n=1, nn, my(k = 1); while (!issquare(prec^2+n^2+k), k++); listput(list, k); prec = k;); Vec(list);} \\ Michel Marcus, Sep 13 2021
  • Python
    from math import isqrt
    A347594_list = [1]
    for n in range(1,10**3):
        m = A347594_list[n-1]**2+n**2
        A347594_list.append((isqrt(m)+1)**2-m) # Chai Wah Wu, Sep 12 2021