|
|
A366962
|
|
Numbers whose difference between the largest and smallest digits is equal to 5.
|
|
9
|
|
|
16, 27, 38, 49, 50, 61, 72, 83, 94, 105, 116, 126, 136, 146, 150, 156, 161, 162, 163, 164, 165, 166, 205, 216, 227, 237, 247, 250, 257, 261, 267, 272, 273, 274, 275, 276, 277, 305, 316, 327, 338, 348, 350, 358, 361, 368, 372, 378, 383, 384, 385, 386, 387, 388
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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.
|
|
LINKS
|
|
|
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
(PARI) isok(n) = my(d=digits(n)); vecmax(d) - vecmin(d) == 5; \\ Michel Marcus, Nov 05 2023
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|