login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A366964 Numbers whose difference between the largest and smallest digits is equal to 7. 9
18, 29, 70, 81, 92, 107, 118, 128, 138, 148, 158, 168, 170, 178, 181, 182, 183, 184, 185, 186, 187, 188, 207, 218, 229, 239, 249, 259, 269, 270, 279, 281, 289, 292, 293, 294, 295, 296, 297, 298, 299, 307, 318, 329, 370, 381, 392, 407, 418, 429, 470, 481, 492 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
The number of n-digit terms is 23*8^(n-1) - 41*7^(n-1) + 2^n*3^(n+1).
LINKS
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
Cf. A037904.
Cf. A010785 (difference = 0), A366958 (difference = 1), A366959 (difference = 2), A366960 (difference = 3), A366961 (difference = 4), A366962 (difference = 5), A366963 (difference = 6), A366965 (difference = 8), A366966 (difference = 9).
Sequence in context: A205871 A144833 A259635 * A032612 A151700 A154367
KEYWORD
nonn,base,easy
AUTHOR
Stefano Spezia, Oct 30 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 8 05:21 EDT 2024. Contains 374149 sequences. (Running on oeis4.)