OFFSET
1,2
PROG
(Python)
from sympy import integer_nthroot
def a(n):
target = 2 * int(str(n) + '9'*(n-len(str(n))))
r, exact = integer_nthroot(target, 2)
while (r-1)*r//2 <= target//2: r += 1
return (r-2)*(r-1)//2
print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Jan 28 2021
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Nov 08 2002
EXTENSIONS
More terms from Sascha Kurz, Jan 04 2003
STATUS
approved