login
A257631
Near-repunit triangular numbers.
0
10, 15, 21, 91, 171, 1711
OFFSET
1,1
COMMENTS
A near-repunit number is a number all but one of whose digits are 1's. No other near-repunit triangular number is known up to 10^15.
No more terms less than 10^1000. It is likely there are no more terms. - Chai Wah Wu, Mar 25 2020
PROG
(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
CROSSREFS
KEYWORD
base,nonn,more
AUTHOR
Shyam Sunder Gupta, Jul 12 2015
STATUS
approved