login
A077506
Smallest n-digit triangular number beginning with n.
2
1, 21, 300, 4005, 50086, 600060, 7003153, 80004925, 900003951, 1000006281, 11000078650, 120000270151, 1300001532378, 14000004645256, 150000007349286, 1600000000287153, 17000000065300605, 180000000300000000, 1900000001049159015, 20000000001032428860
OFFSET
1,2
LINKS
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
Cf. A000217, A077507 (largest).
Sequence in context: A295377 A021604 A025935 * A007592 A019664 A019839
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Nov 08 2002
EXTENSIONS
More terms from Sascha Kurz, Jan 04 2003
STATUS
approved