OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
MATHEMATICA
sntn[x_]:=Module[{c=Ceiling[(Sqrt[1+8(x 10^(x-IntegerLength[x]))]-1)/2]}, (c(c+1))/2]; Array[sntn, 30] (* Harvey P. Dale, May 10 2021 *)
PROG
(Python)
from sympy import integer_nthroot
def a(n):
target = 2 * int(str(n) + '0'*(n-len(str(n))))
r, exact = integer_nthroot(target, 2)
while r*(r+1)//2 >= target//2: r -= 1
return (r+1)*(r+2)//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