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.

Previous Showing 11-20 of 26 results. Next

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
    

A366964 Numbers whose difference between the largest and smallest digits is equal to 7.

Original entry on oeis.org

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

Views

Author

Stefano Spezia, Oct 30 2023

Keywords

Comments

The number of n-digit terms is 23*8^(n-1) - 41*7^(n-1) + 2^n*3^(n+1).

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).

Programs

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

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
    

A040163 a(n) is the absolute value of (the first digit of n minus the last digit of n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 0, 1, 2, 3, 4, 5
Offset: 1

Views

Author

Keywords

Examples

			a(371) = abs(3 - 1) = 2.
a(567) = abs(5 - 7) = 2.
		

Crossrefs

Cf. A000030 (first digit of n), A010879 (last digit of n).

Programs

  • Mathematica
    Array[Abs[First@ # - Last@ #] &@ IntegerDigits@ # &, 106] (* Michael De Vlieger, Oct 15 2018 *)
  • PARI
    a(n) = my(digs = digits(n)); abs(digs[1] - digs[#digs]); \\ Michel Marcus, Sep 27 2013
    
  • PARI
    apply( {A040163(n)=abs(n\10^logint(n+!n,10)-n%10)}, [0..111]) \\ M. F. Hasler, Apr 22 2024
    
  • Python
    for n in range(1,51): print(abs(int(str(n)[0])-int(str(n)[-1]))) # David F. Marrs, Oct 14 2018

Formula

a(n) = abs(floor(n / 10 ^ floor(log_10(n))) - (n - floor(n / 10) * 10)) - David F. Marrs, Oct 14 2018

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

A040114 List of absolute values of differences between digits of 10, 11, 12, ..., listed digit by digit.

Original entry on oeis.org

1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5
Offset: 10

Views

Author

Keywords

Comments

Start with the empty sequence. For n = 10, 11, 12, ... do the following. Let the decimal expansion of n be abcd...efg, say. Append the numbers |a-b|, |b-c|, |c-d|, ... |e-f|, |f-g| to the sequence.
The offset is slightly misleading since for n > 99 the index n is in no direct relation with the number whose digits are used to produce a(n), in contrast to A040115 where all digit-differences of n are concatenated, and leading zeros don't appear. For example, a(100) = 1 and a(101) = 0 are the two differences between the digits of 100. Similarly, a(100 + 2k) corresponds to the difference between first and second digit of 100 + k. Therefore, a(120) = 0. - M. F. Hasler, Nov 09 2019

Examples

			From _M. F. Hasler_, Nov 09 2019: (Start)
The first term is the difference between digits of 10, which is 1.
The second term is the difference between digits of 11, which is 0.
The 100th term is the difference between the first two digits of 100, 1-0 = 1.
The 101st term is the difference between the last two digits of 100, 0-0 = 0.
The 120th term is the difference between the first two digits of 110, 1-1 = 0: Here "leading zeros" are preserved, in contrast to A040115 where all digit-wise differences of any n are concatenated to one term, and leading zeros disappear.
(End)
When we reach n = 371, for example, we append 4 and 6 to the sequence.
		

Crossrefs

Programs

  • Mathematica
    Flatten[Table[Abs[Differences[IntegerDigits[n]]],{n,10,200}]] (* Harvey P. Dale, Jun 28 2021 *)

Extensions

Definition clarified by N. J. A. Sloane, Aug 19 2008.
Name edited by M. F. Hasler, Nov 09 2019

A115300 Greatest digit of n * least digit of n.

Original entry on oeis.org

1, 4, 9, 16, 25, 36, 49, 64, 81, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 0, 7, 14, 21, 28, 35, 42, 49, 56, 63, 0, 8
Offset: 1

Views

Author

Rick L. Shepherd, Jan 20 2006

Keywords

Comments

a(101) = 0 and A111707(101) = 1, but all previous terms match.
a(n) = A169669(n) for n <= 100.

Examples

			a(3) = 3 * 3 = 9, a(232) = 3 * 2 = 6, a(1889009898) = 9 * 0 = 0.
		

Crossrefs

Cf. A037904 (greatest-least), A115299 (greatest+least), A111707.

Programs

  • Haskell
    a115300 n = a054054 n * a054055 n  -- Reinhard Zumkeller, Apr 29 2015
    
  • Mathematica
    Array[Max[#] * Min[#] &@ IntegerDigits[#] &, 81] (* James C. McMahon, Aug 18 2024 *)
  • PARI
    a(n) = my(d=digits(n)); vecmin(d)*vecmax(d); \\ Michel Marcus, Aug 18 2024
  • Python
    def a(n): d = list(map(int, str(n))); return max(d) * min(d)
    print([a(n) for n in range(1, 82)]) # Michael S. Branicky, Dec 12 2023
    

Formula

a(n) = A054054(n)*A054055(n). - Reinhard Zumkeller, Apr 29 2015

A115299 Greatest digit of n + least digit of n. Different from A088133.

Original entry on oeis.org

2, 4, 6, 8, 10, 12, 14, 16, 18, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 8, 9, 10, 11, 12, 13, 14
Offset: 1

Views

Author

Rick L. Shepherd, Jan 20 2006

Keywords

Comments

a(101) = 1 and A088133(101) = 2, but all previous terms match.

Examples

			a(1) = 1 + 1 = 2, a(232) = 3 + 2 = 5, a(1889009898) = 9 + 0 = 9.
		

Crossrefs

Cf. A037904 (greatest-least), A115300 (greatest*least), A088133 (first+last).

Programs

  • Mathematica
    Array[Max[#] + Min[#] &@ IntegerDigits[#] &, 120] (* Michael De Vlieger, Dec 12 2023 *)
  • Python
    def a(n): d = list(map(int, str(n))); return max(d) + min(d)
    print([a(n) for n in range(1, 87)]) # Michael S. Branicky, Dec 12 2023
Previous Showing 11-20 of 26 results. Next