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