A031955 Numbers with exactly two distinct base-10 digits.
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, 100, 101, 110, 112, 113, 114, 115, 116, 117, 118, 119, 121, 122, 131, 133, 141, 144, 151, 155, 161, 166
Offset: 1
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Index entries for 10-automatic sequences.
Crossrefs
Programs
-
Haskell
a031955 n = a031955_list !! (n-1) a031955_list = filter ((== 2) . a043537) [0..] -- Reinhard Zumkeller, Feb 05 2012
-
Maple
M:= 5: # to get all terms < 10^M sort([seq(seq(seq(seq(add(10^(m-j)*`if`(member(j,S2),d2,d1),j=1..m) , S2 = combinat:-powerset({$2..m}) minus {{}}), d2 = {$0..9} minus {d1}), d1 = 1..9), m=2..M)]); # Robert Israel, Dec 03 2015
-
Mathematica
Select[Range@ 166, Length@ Union@ IntegerDigits@ # == 2 &] (* Michael De Vlieger, Dec 03 2015 *)
-
PARI
is_A031955(n)=#Set(digits(n))==2 \\ M. F. Hasler, Apr 04 2015
-
Python
def ok(n): return len(set(str(n))) == 2 print(list(filter(ok, range(167)))) # Michael S. Branicky, Oct 12 2021
Formula
A043537(a(n)) = 2. - Reinhard Zumkeller, Dec 03 2009
Extensions
Name edited by Charles R Greathouse IV, Feb 13 2017
Comments