login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Near-repunit triangular numbers.
0

%I #30 Oct 15 2021 06:06:04

%S 10,15,21,91,171,1711

%N Near-repunit triangular numbers.

%C 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.

%C No more terms less than 10^1000. It is likely there are no more terms. - _Chai Wah Wu_, Mar 25 2020

%o (Python)

%o from sympy import integer_nthroot

%o def istri(n): return integer_nthroot(8*n+1, 2)[1]

%o def near_repunits(digits):

%o for loc in range(1, digits):

%o yield int("1"*loc + "0" + "1"*(digits-loc-1))

%o for loc in range(1, digits+1):

%o for d in "23456789":

%o yield int("1"*(digits-loc) + d + "1"*(loc-1))

%o def afind(maxdigits):

%o for digits in range(2, maxdigits+1):

%o for t in near_repunits(digits):

%o if istri(t): print(t, end=", ")

%o afind(200) # _Michael S. Branicky_, Oct 15 2021

%Y Cf. A000217, A002275, A062690, A257630.

%K base,nonn,more

%O 1,1

%A _Shyam Sunder Gupta_, Jul 12 2015