login
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.
6
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,2
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.
LINKS
EXAMPLE
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.
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 *)
PROG
(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
(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
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Scott R. Shannon, Sep 08 2021
STATUS
approved