cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A366961 Numbers whose difference between the largest and smallest digits is equal to 4.

Original entry on oeis.org

15, 26, 37, 40, 48, 51, 59, 62, 73, 84, 95, 104, 115, 125, 135, 140, 145, 151, 152, 153, 154, 155, 204, 215, 226, 236, 240, 246, 251, 256, 262, 263, 264, 265, 266, 304, 315, 326, 337, 340, 347, 351, 357, 362, 367, 373, 374, 375, 376, 377, 400, 401, 402, 403, 404, 410
Offset: 1

Views

Author

Stefano Spezia, Oct 30 2023

Keywords

Comments

The number of n-digit terms is 29*5^(n-1) - 47*4^(n-1) + 2*3^(n+1).

Crossrefs

Cf. A037904.
Cf. A010785 (difference = 0), A366958 (difference = 1), A366959 (difference = 2), A366960 (difference = 3), A366962 (difference = 5), A366963 (difference = 6), A366964 (difference = 7), A366965 (difference = 8), A366966 (difference = 9).

Programs

  • Mathematica
    Select[Range[410],Max[d=IntegerDigits[#]]-Min[d]==4 &]
  • PARI
    isok(n) = my(d=digits(n)); vecmax(d) - vecmin(d) == 4; \\ Michel Marcus, Nov 05 2023
  • Python
    def ok(n): return max(d:=list(map(int, str(n))))-min(d) == 4
    print([k for k in range(411) if ok(k)]) # Michael S. Branicky, Oct 30 2023