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