A383304 Nonnegative integers whose difference between the largest and smallest digits is equal to the arithmetic mean of its digits.
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
Examples
144 is a term since 4 - 1 = 3 = (1 + 4 + 4)/3.
Crossrefs
Programs
-
Mathematica
Select[Range[0,1500], Max[d=IntegerDigits[#]]-Min[d]==Mean[d] &]
-
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