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.

Showing 1-9 of 9 results.

A366959 Numbers whose difference between the largest and smallest digits is equal to 2.

Original entry on oeis.org

13, 20, 24, 31, 35, 42, 46, 53, 57, 64, 68, 75, 79, 86, 97, 102, 113, 120, 123, 131, 132, 133, 200, 201, 202, 210, 213, 220, 224, 231, 234, 242, 243, 244, 311, 312, 313, 321, 324, 331, 335, 342, 345, 353, 354, 355, 422, 423, 424, 432, 435, 442, 446, 453, 456, 464, 465, 466
Offset: 1

Views

Author

Stefano Spezia, Oct 30 2023

Keywords

Comments

The number of n-digit terms of this sequence is (46*3^n - 93*2^n + 48)/6.

Crossrefs

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

Programs

  • Maple
    F:= proc(d) local L,i;
       L:= select(t -> max(t) = 2 and min(t) = 0, map(convert,[$3^d..2*3^d-1],base,3));
       L:= map(t -> add(t[-i-1]*10^(i-1),i=1..nops(t)-1),L);
       L:= map(t -> seq(t+i*(10^d-1)/9,i=0..7), L);
       op(sort(select(t -> t >= 10^(d-1), L)));
    end proc:
    F(2), F(3), F(4); # Robert Israel, Nov 10 2023
  • Mathematica
    Select[Range[500],Max[d=IntegerDigits[#]]-Min[d]==2 &]
  • PARI
    isok(n) = my(d=digits(n)); vecmax(d) - vecmin(d) == 2; \\ Michel Marcus, Nov 05 2023
  • Python
    def ok(n): return max(d:=list(map(int, str(n))))-min(d) == 2
    print([k for k in range(500) if ok(k)]) # Michael S. Branicky, Oct 30 2023
    
  • Python
    from itertools import chain, count, islice, combinations_with_replacement
    from sympy.utilities.iterables import multiset_permutations
    def A366959_gen(): # generator of terms
        return chain.from_iterable(sorted(int(''.join(str(d) for d in t)) for a in range(8) for c in combinations_with_replacement(range(a,a+3),l) for t in multiset_permutations((a,a+2)+c) if t[0]) for l in count(0))
    A366959_list = list(islice(A366959_gen(),30)) # Chai Wah Wu, Nov 10 2023
    

A366960 Numbers whose difference between the largest and smallest digits is equal to 3.

Original entry on oeis.org

14, 25, 30, 36, 41, 47, 52, 58, 63, 69, 74, 85, 96, 103, 114, 124, 130, 134, 141, 142, 143, 144, 203, 214, 225, 230, 235, 241, 245, 252, 253, 254, 255, 300, 301, 302, 303, 310, 314, 320, 325, 330, 336, 341, 346, 352, 356, 363, 364, 365, 366, 411, 412, 413, 414
Offset: 1

Views

Author

Stefano Spezia, Oct 30 2023

Keywords

Comments

The number of n-digit terms of this sequence is 27*4^(n-1) - 41*3^(n-1) + 7*2^n.

Crossrefs

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

Programs

  • Mathematica
    Select[Range[415],Max[d=IntegerDigits[#]]-Min[d]==3 &]
  • PARI
    isok(n) = my(d=digits(n)); vecmax(d) - vecmin(d) == 3; \\ Michel Marcus, Nov 05 2023
  • Python
    def ok(n): return max(d:=list(map(int, str(n))))-min(d) == 3
    print([k for k in range(420) if ok(k)]) # Michael S. Branicky, Oct 30 2023
    
  • Python
    from itertools import chain, count, islice, combinations_with_replacement
    from sympy.utilities.iterables import multiset_permutations
    def A366960_gen(): # generator of terms
        return chain.from_iterable(sorted(int(''.join(str(d) for d in t)) for a in range(7) for c in combinations_with_replacement(range(a,a+4),l) for t in multiset_permutations((a,a+3)+c) if t[0]) for l in count(0))
    A366960_list = list(islice(A366960_gen(),30)) # Chai Wah Wu, Nov 10 2023
    

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
    

A366962 Numbers whose difference between the largest and smallest digits is equal to 5.

Original entry on oeis.org

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
Offset: 1

Views

Author

Stefano Spezia, Oct 30 2023

Keywords

Comments

The number of n-digit terms of this sequence is 29*6^(n-1) - 49*5^(n-1) + 5*4^n.

Crossrefs

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

Programs

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

A366963 Numbers whose difference between the largest and smallest digits is equal to 6.

Original entry on oeis.org

17, 28, 39, 60, 71, 82, 93, 106, 117, 127, 137, 147, 157, 160, 167, 171, 172, 173, 174, 175, 176, 177, 206, 217, 228, 238, 248, 258, 260, 268, 271, 278, 282, 283, 284, 285, 286, 287, 288, 306, 317, 328, 339, 349, 359, 360, 369, 371, 379, 382, 389, 393, 394, 395, 396, 397, 398, 399
Offset: 1

Views

Author

Stefano Spezia, Oct 30 2023

Keywords

Comments

The number of n-digit terms of this sequence is 27*7^(n-1) - 47*6^(n-1) + 4*5^n.

Crossrefs

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

Programs

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

A366965 Numbers whose difference between the largest and smallest digits is equal to 8.

Original entry on oeis.org

19, 80, 91, 108, 119, 129, 139, 149, 159, 169, 179, 180, 189, 191, 192, 193, 194, 195, 196, 197, 198, 199, 208, 219, 280, 291, 308, 319, 380, 391, 408, 419, 480, 491, 508, 519, 580, 591, 608, 619, 680, 691, 708, 719, 780, 791, 800, 801, 802, 803, 804, 805, 806, 807, 808, 810
Offset: 1

Views

Author

Stefano Spezia, Oct 30 2023

Keywords

Comments

The number of n-digit terms of this sequence is 17*9^(n-1) - 31*8^(n-1) + 2*7^n.

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), A366964 (difference = 7), A366966 (difference = 9).

Programs

  • Mathematica
    Select[Range[810],Max[d=IntegerDigits[#]]-Min[d]==8 &]
  • PARI
    isok(n) = my(d=digits(n)); vecmax(d) - vecmin(d) == 8; \\ Michel Marcus, Nov 05 2023
  • 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
    

A366966 Numbers whose difference between the largest and smallest digits is equal to 9.

Original entry on oeis.org

90, 109, 190, 209, 290, 309, 390, 409, 490, 509, 590, 609, 690, 709, 790, 809, 890, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 920, 930, 940, 950, 960, 970, 980, 990, 1009, 1019, 1029, 1039, 1049, 1059, 1069, 1079, 1089, 1090, 1091, 1092, 1093, 1094, 1095
Offset: 1

Views

Author

Stefano Spezia, Oct 30 2023

Keywords

Comments

The number of n-digit terms of this sequence is 9*10^(n-1) - 17*9^(n-1) + 8^n.

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), A366964 (difference = 7), A366965 (difference = 8).

Programs

  • Mathematica
    Select[Range[1095],Max[d=IntegerDigits[#]]-Min[d]==9 &]
  • PARI
    isok(n) = my(d=digits(n)); vecmax(d) - vecmin(d) == 9; \\ Michel Marcus, Nov 05 2023
  • Python
    def ok(n): return max(d:=list(map(int, str(n))))-min(d) == 9
    print([k for k in range(1100) if ok(k)]) # Michael S. Branicky, Oct 30 2023
    
  • Python
    from itertools import chain, count, islice, combinations_with_replacement
    from sympy.utilities.iterables import multiset_permutations
    def A366966_gen(): # generator of terms
        return chain.from_iterable(sorted(int(''.join(str(d) for d in t)) for c in combinations_with_replacement(range(10),l) for t in multiset_permutations((0,9)+c) if t[0]) for l in count(0))
    A366966_list = list(islice(A366966_gen(),30)) # Chai Wah Wu, Nov 10 2023
    

A366958 Numbers whose difference between the largest and smallest digits is equal to 1.

Original entry on oeis.org

10, 12, 21, 23, 32, 34, 43, 45, 54, 56, 65, 67, 76, 78, 87, 89, 98, 100, 101, 110, 112, 121, 122, 211, 212, 221, 223, 232, 233, 322, 323, 332, 334, 343, 344, 433, 434, 443, 445, 454, 455, 544, 545, 554, 556, 565, 566, 655, 656, 665, 667, 676, 677, 766, 767, 776, 778, 787, 788
Offset: 1

Views

Author

Stefano Spezia, Oct 30 2023

Keywords

Comments

The number of n-digit terms of this sequence is 17*A000225(n-1).

Crossrefs

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

Programs

  • Mathematica
    Select[Range[800],Max[d=IntegerDigits[#]]-Min[d]==1 &]
  • PARI
    isok(n) = my(d=digits(n)); vecmax(d) - vecmin(d) == 1; \\ Michel Marcus, Oct 30 2023
    
  • Python
    def ok(n): return max(d:=list(map(int, str(n))))-min(d) == 1
    print([k for k in range(800) if ok(k)]) # Michael S. Branicky, Oct 30 2023
    
  • Python
    # faster version for large terms
    from itertools import count, islice, product
    def agen(diff=1): # generator of terms; change diff for A366960-A366966
        for digits in count(2):
            s = set()
            for lo in range(10-diff):
                hi = lo + diff
                allowed = list(range(lo, hi+1))
                for p in product(allowed, repeat=digits):
                    if p[0]==0 or lo not in p or hi not in p: continue
                    s.add(int("".join(map(str, p))))
            yield from sorted(s)
    print(list(islice(agen(), 60))) # Michael S. Branicky, Oct 30 2023

A367248 a(n) is the number of n-digit numbers whose difference between the largest and smallest digits is equal to 7.

Original entry on oeis.org

0, 5, 111, 1601, 19095, 204545, 2045511, 19508081, 179752215, 1613908385, 14202967911, 123028446161, 1052237271735, 8907026785025, 74758478722311, 623053865857841, 5162154289325655, 42558224511290465, 349394287423788711, 2858263098464575121, 23311522539676521975
Offset: 1

Views

Author

Stefano Spezia, Nov 11 2023

Keywords

Comments

a(n) is the number of n-digit numbers in A366964.

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{21,-146,336},{0,5,111},21]

Formula

a(n) = 23*8^(n-1) - 41*7^(n-1) + 3*6^n.
a(n) = 21*a(n-1) - 146*a(n-2) + 336*a(n-3) for n > 3.
O.g.f.: x^2*(5 + 6*x)/((1 - 6*x)*(1 - 7*x)*(1 - 8*x)).
E.g.f.: (161*exp(8*x) - 328*exp(7*x) + 168*exp(6*x) - 1)/56.
Showing 1-9 of 9 results.