cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A136400 Replace all digits greater than 1 with 1 (in decimal representation).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Dec 30 2007

Keywords

Comments

A054055(a(n)) <= 1; A064770(a(n)) = a(n).

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

Formula

a(n) = A064770(A064770(n)).