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 41-50 of 171 results. Next

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
    

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
    

A014181 Numbers > 9 with all digits the same.

Original entry on oeis.org

11, 22, 33, 44, 55, 66, 77, 88, 99, 111, 222, 333, 444, 555, 666, 777, 888, 999, 1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999, 11111, 22222, 33333, 44444, 55555, 66666, 77777, 88888, 99999, 111111, 222222, 333333, 444444, 555555, 666666, 777777, 888888
Offset: 1

Views

Author

Keywords

Comments

Original definition: Numbers in which all digits are repeated. (This would also include all terms of A033023 (e.g., 1100, 1122, ...) and maybe also 1010, 1212, etc.) - M. F. Hasler, Jun 24 2016

Crossrefs

Same as A010785 except for one-digit numbers.

Programs

  • Mathematica
    Table[Map[FromDigits@ Table[#, k] &, Range@ 9], {k, 2, 6}] // Flatten (* Michael De Vlieger, Jun 24 2016 *)
  • PARI
    A014181(n)=10^((n+17)\9)\9*((n-1)%9+1) \\ See A010785 for a nxt() function. - M. F. Hasler, Jun 24 2016

Extensions

Better definition and offset changed to 1 by M. F. Hasler, Jun 24 2016

A090287 Smallest prime obtained by sandwiching n between a number with identical digits, or 0 if no such prime exists. Primes of the form k n k where all the digits of k are identical.

Original entry on oeis.org

101, 313, 727, 131, 11411, 151, 777767777, 373, 181, 191, 9109, 0, 7127, 331333, 991499, 1151, 3163, 1171, 1181, 9199, 1201, 112111, 0, 1231, 7247, 3253, 7777777777267777777777, 1111271111, 11128111, 1291, 1301, 3313, 1321, 0, 3343, 333533, 1361, 3373, 1381
Offset: 0

Views

Author

Amarnath Murthy, Nov 29 2003

Keywords

Comments

a(n) = 0 if n is a palindrome with even number of digits. Conjecture: No other term is zero.
The conjecture is false. a(231) = 0, a(420) = 0, a(n) = 0 if 11 divides n and n has an even number of digits. a(1414) has over 2000 digits. - Chai Wah Wu, Mar 31 2015

Crossrefs

Programs

  • Mathematica
    (* f(n) defined by José de Jesús Camacho Medina in A010785. *)
    lst={};f[m_]:=IntegerDigits[(m-9*Floor[(m-1)/9])*(10^Floor[(m+8)/9]-1)/9];
    g[n_]:=FromDigits[Flatten[{f[m],IntegerDigits[n],f[m]}]];
    Do[m=1;While[True,If[Mod[Length[IntegerDigits[n]],2]==0&&IntegerDigits[n]==Reverse[IntegerDigits[n]],
    AppendTo[lst,0];Break[],If[PrimeQ[g[n]],AppendTo[lst,g[n]];Break[]]];m++],{n,25}];
    lst (* Ivan N. Ianakiev, Mar 23 2015 *)
  • Python
    from gmpy2 import is_prime, mpz, digits
    def A090287(n, limit=2000):
        sn = str(n)
        if n in (231, 420, 759) or not (len(sn) % 2 or n % 11):
            return 0
        for i in range(1, limit+1):
            for j in range(1, 10, 2):
                si = digits(j, 10)*i
                p = mpz(si+sn+si)
                if is_prime(p):
                    return int(p)
        else:
            return 'search limit reached.' # Chai Wah Wu, Mar 31 2015

Extensions

a(0) from Chai Wah Wu, Mar 23 2015
a(26)-a(38) from Chai Wah Wu, Mar 24 2015
Previous Showing 41-50 of 171 results. Next