A343039 a(1) = 1, for n > 1, a(n) is the smallest positive integer for which a(n-1) + n + a(n) is a square.
1, 1, 5, 7, 4, 6, 3, 5, 2, 4, 1, 3, 9, 2, 8, 1, 7, 11, 6, 10, 5, 9, 4, 8, 3, 7, 2, 6, 1, 5, 13, 4, 12, 3, 11, 2, 10, 1, 9, 15, 8, 14, 7, 13, 6, 12, 5, 11, 4, 10, 3, 9, 2, 8, 1, 7, 17, 6, 16, 5, 15, 4, 14, 3, 13, 2, 12, 1, 11
Offset: 1
Keywords
Links
- Todor Szimeonov, A completive sequence.
Programs
-
Mathematica
d[n_] := Floor[Sqrt[n] + 1]^2 - n; a[1] = 1; a[n_] := a[n] = d[a[n - 1] + n]; Array[a, 100] (* Amiram Eldar, Apr 03 2021 *)
-
Python
from math import isqrt def aupton(terms): alst = [1] for n in range(2, terms+1): alst.append((isqrt(alst[-1] + n)+1)**2 - alst[-1] - n) return alst print(aupton(79)) # Michael S. Branicky, Apr 03 2021