login
A383304
Nonnegative integers whose difference between the largest and smallest digits is equal to the arithmetic mean of its digits.
1
0, 13, 26, 31, 39, 62, 93, 123, 132, 144, 213, 225, 231, 246, 252, 264, 267, 276, 288, 312, 321, 348, 369, 384, 396, 414, 426, 438, 441, 462, 483, 522, 624, 627, 639, 642, 672, 693, 726, 762, 828, 834, 843, 882, 936, 963, 1133, 1223, 1232, 1313, 1322, 1331, 1344, 1434, 1443
OFFSET
1,2
EXAMPLE
144 is a term since 4 - 1 = 3 = (1 + 4 + 4)/3.
MATHEMATICA
Select[Range[0, 1500], Max[d=IntegerDigits[#]]-Min[d]==Mean[d] &]
PROG
(Python)
def ok(n): return sum(d:=list(map(int, str(n)))) == (max(d) - min(d))*len(d)
print([k for k in range(1500) if ok(k)]) # Michael S. Branicky, Apr 23 2025
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Stefano Spezia, Apr 22 2025
STATUS
approved