login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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, 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,3
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 *)
PROG
(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
CROSSREFS
Sequence in context: A300081 A293843 A240946 * A021178 A201506 A344388
KEYWORD
nonn
AUTHOR
Todor Szimeonov, Apr 03 2021
STATUS
approved