login
A257630
Near-repdigit triangular numbers.
1
10, 15, 21, 28, 36, 45, 78, 91, 171, 300, 595, 990, 1711, 5565, 6555, 66066, 333336
OFFSET
1,1
COMMENTS
A near-repdigit is a number having all digits but one equal. No other near-repdigit 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
MATHEMATICA
nrepQ[n_] := Module[{dg = Select[DigitCount[n], # > 0 &]}, Length[dg] == 2 && Min[dg] == 1 && Max[dg] > 0]; Select[
Table[n*(n + 1)/2, {n, 10000}], nrepQ]
PROG
(Python)
from sympy import integer_nthroot
def istri(n): return integer_nthroot(8*n+1, 2)[1]
def near_repdigits(digits):
s = set()
for d1 in "0123456789":
for d2 in set("0123456789") - {d1}:
for loc in range(1, digits+1):
nrd = d1*(digits-loc) + d2 + d1*(loc-1)
if nrd[0] != "0": s.add(int(nrd))
return sorted(s)
def afind(maxdigits):
for digits in range(2, maxdigits+1):
for t in near_repdigits(digits):
if istri(t): print(t, end=", ")
afind(100) # Michael S. Branicky, Oct 15 2021
CROSSREFS
KEYWORD
base,nonn,more
AUTHOR
Shyam Sunder Gupta, Jul 12 2015
STATUS
approved