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