A178788 Characteristic function of numbers having distinct digits in their decimal representation.
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
Links
- R. Zumkeller, Table of n, a(n) for n = 0..10000
- Michael De Vlieger, Plot a(n) at (x,y) = (n mod 1000, -floor(n/1000)), n = 1..10^6, where black represents a(n) = 1 and white represents a(n) = 0.
- Eric Weisstein's World of Mathematics, Digit
- Index entries for characteristic functions
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 *)
Comments