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-10 of 11 results. Next

A010784 Numbers with distinct decimal digits.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 102, 103, 104, 105, 106, 107, 108, 109, 120
Offset: 1

Views

Author

Keywords

Comments

More than the usual number of terms are displayed in order to show the difference from some closely related sequences.
Also: a(1) = 0; a(n) = Min{x integer | x > a(n-1) and all digits to base 10 are distinct}.
This sequence is finite: a(8877691) = 9876543210 is the last term; a(8877690) = 9876543201. The largest gap between two consecutive terms before a(249999) = 2409653 is 104691, as a(175289) = 1098765, a(175290) = 1203456. - Reinhard Zumkeller, Jun 23 2001
Complement of A109303. - David Wasserman, May 21 2008
For the analogs in other bases b, search for "xenodromes." A001339(b-1) is the number of base b xenodromes for b >= 2. - Rick L. Shepherd, Feb 16 2013
A073531 gives the number of positive n-digit numbers in this sequence. Note that it does not count 0. - T. D. Noe, Jul 09 2013
Can be seen as irregular table whose n-th row holds the n-digit terms; length of row n is then A073531(n) = 9*9!/(10-n)! except for n = 1 where we have 10 terms, unless 0 is considered to belong to a row 0. - M. F. Hasler, Dec 10 2018

Crossrefs

Subsequence of A043096.
Cf. A109303, A029740 (odds), A029741 (evens), A029743 (primes), A001339.

Programs

  • Haskell
    a010784 n = a010784_list !! (n-1)
    a010784_list = filter ((== 1) . a178788) [1..]
    -- Reinhard Zumkeller, Sep 29 2011
    
  • Mathematica
    Select[Range[0,100], Max[DigitCount[#]] == 1 &] (* Harvey P. Dale, Apr 04 2013 *)
  • PARI
    is(n)=my(v=vecsort(digits(n)));v==vecsort(v,,8) \\ Charles R Greathouse IV, Sep 17 2012
    
  • PARI
    select( is(n)=!n||#Set(digits(n))==logint(n,10)+1, [0..120]) \\ M. F. Hasler, Dec 10 2018
    
  • PARI
    apply( A010784_row(n,L=List(if(n>1,[])))={forvec(d=vector(n,i,[0,9]),forperm(d,p,p[1]&&listput(L,fromdigits(Vec(p)))),2);Set(L)}, [1..2]) \\ A010784_row(n) returns all terms with n digits. - M. F. Hasler, Dec 10 2018
    
  • Python
    A010784_list = [n for n in range(10**6) if len(set(str(n))) == len(str(n))] # Chai Wah Wu, Oct 13 2019
    
  • Python
    # alternate for generating full sequence
    from itertools import permutations
    afull = [0] + [int("".join(p)) for d in range(1, 11) for p in permutations("0123456789", d) if p[0] != "0"]
    print(afull[:100]) # Michael S. Branicky, Aug 04 2022
    
  • Scala
    def hasDistinctDigits(n: Int): Boolean = {
      val numerStr = n.toString
      val digitSet = numerStr.split("").toSet
      numerStr.length == digitSet.size
    }
    (0 to 99).filter(hasDistinctDigits) // Alonso del Arte, Jan 09 2020

Formula

A178788(a(n)) = 1; A178787(a(n)) = n; A043537(a(n)) = A055642(a(n)). - Reinhard Zumkeller, Jun 30 2010
A107846(a(n)) = 0. - Reinhard Zumkeller, Jul 09 2013

Extensions

Offset changed to 1 and first comment adjusted by Reinhard Zumkeller, Jun 14 2010

A178788 Characteristic function of numbers having distinct digits in their decimal representation.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 30 2010

Keywords

Comments

a(A010784(n)) = 1; a(A109303(n)) = 0;
first differences of A178787.
a(n) <= A196368(n).
a(n) = 0 for n > 9*9!. - Hieronymus Fischer, Feb 02 2013

Programs

  • Haskell
    import Data.List (nub)
    a178788 n = fromEnum $ nub (show n) == show n
    -- Reinhard Zumkeller, Sep 25 2011
  • Mathematica
    lst = {}; Do[If[Select[Tally[IntegerDigits[n]][[All, 2]], # > 1 &] == {}, AppendTo[lst, 1], AppendTo[lst, 0]], {n, 0, 104}]; lst (* Arkadiusz Wesolowski, May 10 2012 *)

Formula

a(n) = 0^(A055642(n)-A043537(n)).

A227362 Distinct digits of n arranged in decreasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 21, 31, 41, 51, 61, 71, 81, 91, 20, 21, 2, 32, 42, 52, 62, 72, 82, 92, 30, 31, 32, 3, 43, 53, 63, 73, 83, 93, 40, 41, 42, 43, 4, 54, 64, 74, 84, 94, 50, 51, 52, 53, 54, 5, 65, 75, 85, 95, 60, 61, 62, 63, 64, 65, 6, 76, 86
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 09 2013

Keywords

Comments

a(n) <= 9876543210; a(a(n)) = a(n);
A055642(a(n)) <= 10;
A055642(a(n)) <= A055642(n), A055642(a(n)) = A055642(n) iff A178788(n) = 1;
a(A109303(n)) < A109303(n); a(A009995(n)) = A009995(n); a(A071589(n)) > A071589(n);
a(n) = A151949(n) + A180410(n).

Crossrefs

Programs

  • Haskell
    import Data.List (nub, sort)
    a227362 = read . reverse . sort . nub . show :: Integer -> Integer
    
  • Maple
    a:= n-> parse(cat(sort([{convert(n, base, 10)[]}[]], `>`)[])):
    seq(a(n), n=0..68);  # Alois P. Heinz, Sep 21 2022
  • Mathematica
    f[n_] := FromDigits[Reverse@ Union@ IntegerDigits@ n]; f /@ Range[0, 68] (* Michael De Vlieger, Apr 16 2015, corrected by Robert G. Wilson v *)
  • PARI
    a(n) = {if (n == 0, d = [0], d = digits(n)); eval(subst(Pol(vecsort(d,,12)), x, 10));} \\ Michel Marcus, Apr 16 2015
    
  • PARI
    a(n)=fromdigits(vecsort(digits(n),,12)) \\ Charles R Greathouse IV, Apr 16 2015
    
  • Python
    def A227362(n): return int(''.join(sorted(set(str(n)),reverse=True))) # Chai Wah Wu, Nov 23 2022

A137564 a(n) is the number formed by removing from n all duplicate digits except the leftmost copy of each.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 2, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 3, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 4, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 5, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 6, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 7, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 8, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 9, 10, 10, 102, 103, 104, 105, 106, 107, 108, 109, 10, 1, 12
Offset: 0

Views

Author

Rick L. Shepherd, Jan 25 2008

Keywords

Comments

Differs from A106612: a(100) = 10, A106612(100) = 100.
Differs from A337864: a(101) = 10, A337864(101) = 101.
a(n)=n iff n is a term of A010784. a(n)A109303.
A010784 is the sequence of distinct terms in this sequence, thus 9876543210 is the largest term here also, as no digit occurs more than once in any given term. Each term except 0 appears infinitely often in this sequence. - Rick L. Shepherd, Oct 03 2020

Examples

			a(100)=10 as a (second) 0 digit is dropped. a(1211323171)=1237.
a(10...1) = 10 for any number of 0's and/or 1's in any order replacing the "..." in the term's index. - _Rick L. Shepherd_, Oct 03 2020
		

Crossrefs

Cf. A106612, A010784 (fixed points), A109303 (non-fixed).
Cf. A043529 (equivalent in binary, except at n=0), A337864.

Programs

A178787 Number of numbers <= n having distinct digits in their decimal representation, cf. A010784.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 61, 62, 63, 64, 65, 66
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 30 2010

Keywords

Comments

a(m)<=a(n) for m=9876543210;
a(A010784(n)) = n; a(A109303(n)) = a(A109303(n)-1);
partial sums of A178788.

Examples

			a(12) = #{0,1,2,3,4,5,6,7,8,9,10,12} = 12;
a(24) = a(12) + #{13,14,15,16,17,18,19,20,21,23,24} = 23.
		

Programs

A084050 Numbers n such that at least one permutation of the digits of n yields a palindrome.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20, 22, 30, 33, 40, 44, 50, 55, 60, 66, 70, 77, 80, 88, 90, 99, 100, 101, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 121, 122, 131, 133, 141, 144, 151, 155, 161, 166, 171, 177, 181, 188, 191, 199, 200, 202, 211, 212, 220, 221
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 26 2003

Keywords

Comments

Union of A037124 and numbers with at most one decimal digit occurring an odd number of times. a(281)=1001 is the first term greater than 90 not also a term of A044959. The terms greater than 90 are a subsequence of A109303. - Rick L. Shepherd, Jun 24 2005

Crossrefs

Cf. A037124 (numbers with only one nonzero digit), A109303 (numbers with at least one duplicate digit).

Extensions

Corrected by Rick L. Shepherd, Jun 24 2005

A107846 Number of duplicate digits of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0
Offset: 0

Views

Author

Rick L. Shepherd, May 24 2005

Keywords

Comments

a(A010784(n)) = 0; a(A109303(n)) > 0. - Reinhard Zumkeller, Jul 09 2013

Examples

			a(11) = 1 because 11 has two total decimal digits but only one distinct digit (1) and 2-1=1.
Similarly, a(3653135) = 7 (total digits) - 4 (distinct digits: 1,3,5,6) = 3 (There are three duplicate digits here, namely, 3, 3 and 5).
		

Crossrefs

Cf. A055642 (Total decimal digits of n), A043537 (Distinct decimal digits of n).

Programs

  • Haskell
    import Data.List (sort, group)
    a107846 = length . concatMap tail . group . sort . show :: Integer -> Int
    -- Reinhard Zumkeller, Jul 09 2013
    
  • Mathematica
    Table[Total[Select[DigitCount[n]-1,#>0&]],{n,0,120}] (* Harvey P. Dale, Jul 31 2013 *)
  • Python
    def a(n): return len(s:=str(n)) - len(set(s))
    print([a(n) for n in range(105)]) # Michael S. Branicky, Jan 09 2023

Formula

a(n) = A055642(n) - A043537(n).

A353181 Numbers in which more than half of the digits are the same.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 100, 101, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 121, 122, 131, 133, 141, 144, 151, 155, 161, 166, 171, 177, 181, 188, 191, 199, 200, 202, 211, 212, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 232
Offset: 1

Views

Author

Zhining Yang, Apr 29 2022

Keywords

Comments

Same as A044959 for terms <= 1000, and then differing at A044959(272) = 1001 which is not a term here (the next instead a(272) = 1011).

Examples

			1211 is a term: it has 4 digits, 3 of which are 1's, and 3/4 > 1/2.
1212 is not a term: it has 4 digits, no one of which appears more than twice.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[300], Max[DigitCount[#]] > IntegerLength[#]/2 &]
  • Python
    def ok(k):
        t=str(k)
        return(max(t.count(str(i)) for i in range(10))>(len(t)//2))
    print([n for n in range(1, 201) if ok(n)])

A073064 Primes with non-distinct digits.

Original entry on oeis.org

11, 101, 113, 131, 151, 181, 191, 199, 211, 223, 227, 229, 233, 277, 311, 313, 331, 337, 353, 373, 383, 433, 443, 449, 499, 557, 577, 599, 661, 677, 727, 733, 757, 773, 787, 797, 811, 877, 881, 883, 887, 911, 919, 929, 977, 991, 997, 1009, 1013, 1019
Offset: 1

Views

Author

Zak Seidov, Aug 24 2002

Keywords

Comments

A000040 INTERSECT A109303. - R. J. Mathar, May 01 2008
Comment from N. J. A. Sloane, Jan 22 2023 (Start)
A "nontrivial permutation" means any one of the m!-1 elements of S_m apart from the identity permutation.
This sequence consists of those primes that are fixed under at least one nontrivial permutation of its digits.
A prime p is in the sequence iff its decimal expansion p = d_1 d_2 ... d_m is such that there is a non-identity permutation pi in S_m with the property that p = d_pi(1) d_pi(2) ... d_pi(m). (End)

Examples

			a(1)=11 because 11 is the first prime not all digits of which are distinct; a(2)=101 because 101 is the second prime not all digits of which are distinct.
		

Crossrefs

Programs

  • Maple
    A055642 := proc(n) max(ilog10(n)+1,1) ; end: A043537 := proc(n) nops(convert(convert(n,base,10),set)) ; end: isA109303 := proc(n) RETURN( A055642(n) > A043537(n) ) ; end: isA073064 := proc(n) RETURN(isprime(n) and isA109303(n) ) ; end: for n from 1 to 1019 do if isA073064(n) then printf("%d,",n) ; fi ; od: # R. J. Mathar, May 01 2008
  • Mathematica
    ta=IntegerDigits[Prime[Range[1000]]]; ta2=Table[Length[ta[[i]]]>Length[Union[ta[[i]]]], {i, 1000}]; Prime[Flatten[Position[ta2, True]]]

A377948 Numbers that have at least 1 repeated decimal digit and whose decimal digits are nondecreasing as place value decreases.

Original entry on oeis.org

11, 22, 33, 44, 55, 66, 77, 88, 99, 111, 112, 113, 114, 115, 116, 117, 118, 119, 122, 133, 144, 155, 166, 177, 188, 199, 222, 223, 224, 225, 226, 227, 228, 229, 233, 244, 255, 266, 277, 288, 299, 333, 334, 335, 336, 337, 338, 339, 344, 355, 366, 377, 388, 399
Offset: 1

Views

Author

Michael De Vlieger, Nov 14 2024

Keywords

Comments

Intersection of A009994 and A109303.
Does not intersect either A009993 or A009995.

Crossrefs

Programs

  • Mathematica
    Select[Range[10^6], And[CountDistinct[#] != Length[#], AllTrue[Differences[#], # >= 0 &]] &[IntegerDigits[#]] &]
    (* More efficient program: *)
    b = 10; mm = b - 1; nn = 14;
    s = Table[Map[Position[#, 1][[All, 1]] &,
      Permutations@ Join[ConstantArray[1, r], ConstantArray[0, mm - r] ] ],
        {r, Min[mm, nn]}];
    Union@ Flatten@ Table[
      w = Apply[Join, Permutations /@ IntegerPartitions[n, Min[mm, n - 1] ] ];
      Reap[Do[
        Sow[Table[FromDigits[Flatten@
          MapIndexed[ConstantArray[m[[First[#2] ]], #1] &,
          w[[i]]], b], {m, s[[Length[w[[i]]] ]]} ] ],
        {i, Length[w]}] ][[-1, 1]], {n, 2, nn}]

Formula

A178788(a(n)) = 0.
Showing 1-10 of 11 results. Next