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”).
%I #23 Oct 15 2021 06:05:47
%S 10,15,21,28,36,45,78,91,171,300,595,990,1711,5565,6555,66066,333336
%N Near-repdigit triangular numbers.
%C A near-repdigit is a number having all digits but one equal. No other near-repdigit 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
%t nrepQ[n_] := Module[{dg = Select[DigitCount[n], # > 0 &]},Length[dg] == 2 && Min[dg] == 1 && Max[dg] > 0]; Select[
%t Table[n*(n + 1)/2, {n, 10000}], nrepQ]
%o (Python)
%o from sympy import integer_nthroot
%o def istri(n): return integer_nthroot(8*n+1, 2)[1]
%o def near_repdigits(digits):
%o s = set()
%o for d1 in "0123456789":
%o for d2 in set("0123456789") - {d1}:
%o for loc in range(1, digits+1):
%o nrd = d1*(digits-loc) + d2 + d1*(loc-1)
%o if nrd[0] != "0": s.add(int(nrd))
%o return sorted(s)
%o def afind(maxdigits):
%o for digits in range(2, maxdigits+1):
%o for t in near_repdigits(digits):
%o if istri(t): print(t, end=", ")
%o afind(100) # _Michael S. Branicky_, Oct 15 2021
%Y Cf. A000217, A010785, A062691.
%K base,nonn,more
%O 1,1
%A _Shyam Sunder Gupta_, Jul 12 2015