A031944 Numbers in which digits 0,1,2 all occur in base 3.
11, 15, 19, 21, 29, 32, 33, 34, 35, 38, 42, 45, 46, 47, 48, 51, 55, 57, 58, 59, 61, 63, 64, 65, 66, 69, 73, 75, 83, 86, 87, 88, 89, 92, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 110, 113, 114, 115, 116, 119, 123, 126, 127, 128, 129, 132, 135
Offset: 1
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Ternary
- Eric Weisstein's World of Mathematics, Pandigital Number
- Wikipedia, Ternary numeral system
- Wikipedia, Pandigital number
Programs
-
Haskell
import Data.List (elemIndices) a031944 n = a031944_list !! (n-1) a031944_list = elemIndices 3 a212193_list -- Reinhard Zumkeller, May 04 2012
-
Mathematica
Select[Range[200],Min[DigitCount[#,3]]>0&] (* Harvey P. Dale, Nov 21 2015 *)
-
Python
from sympy.ntheory import count_digits def ok(n): c = count_digits(n, 3); return all(c[d] > 0 for d in [0, 1, 2]) print([k for k in range(136) if ok(k)]) # Michael S. Branicky, Nov 15 2021
Comments