A136400 Replace all digits greater than 1 with 1 (in decimal representation).
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11
Offset: 0
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..9999
Programs
-
Haskell
a136400 0 = 0 a136400 n = a136400 n' * 10 + min 1 d where (n',d) = divMod n 10 -- Reinhard Zumkeller, Aug 05 2013
-
Mathematica
Table[FromDigits[If[#>1,1,#]&/@IntegerDigits[n]],{n,0,120}] (* Harvey P. Dale, Jul 24 2016 *)
-
PARI
a(n)=subst(Pol(apply(k->min(k,1), digits(n))),'x,10) \\ Charles R Greathouse IV, Jul 31 2013
-
Python
def A136400(n): return int(''.join(str(int(d>='1')) for d in str(n))) # Chai Wah Wu, Oct 29 2024
Comments