A010784 Numbers with distinct decimal digits.
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
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Digit
Crossrefs
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
Comments