OFFSET
1,1
COMMENTS
The number of n-digit terms is 29*5^(n-1) - 47*4^(n-1) + 2*3^(n+1).
MATHEMATICA
Select[Range[410], Max[d=IntegerDigits[#]]-Min[d]==4 &]
PROG
(Python)
def ok(n): return max(d:=list(map(int, str(n))))-min(d) == 4
print([k for k in range(411) if ok(k)]) # Michael S. Branicky, Oct 30 2023
(PARI) isok(n) = my(d=digits(n)); vecmax(d) - vecmin(d) == 4; \\ Michel Marcus, Nov 05 2023
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Stefano Spezia, Oct 30 2023
STATUS
approved