A257631 Near-repunit triangular numbers.
10, 15, 21, 91, 171, 1711
Offset: 1
Programs
-
Python
from sympy import integer_nthroot def istri(n): return integer_nthroot(8*n+1, 2)[1] def near_repunits(digits): for loc in range(1, digits): yield int("1"*loc + "0" + "1"*(digits-loc-1)) for loc in range(1, digits+1): for d in "23456789": yield int("1"*(digits-loc) + d + "1"*(loc-1)) def afind(maxdigits): for digits in range(2, maxdigits+1): for t in near_repunits(digits): if istri(t): print(t, end=", ") afind(200) # Michael S. Branicky, Oct 15 2021
Comments