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.

A103181 In decimal representation of n: replace all even digits with 0 and all odd digits with 1.

This page as a plain text file.
%I A103181 #26 Nov 08 2022 11:23:01
%S A103181 0,1,0,1,0,1,0,1,0,1,10,11,10,11,10,11,10,11,10,11,0,1,0,1,0,1,0,1,0,
%T A103181 1,10,11,10,11,10,11,10,11,10,11,0,1,0,1,0,1,0,1,0,1,10,11,10,11,10,
%U A103181 11,10,11,10,11,0,1,0,1,0,1,0,1,0,1,10,11,10,11,10,11,10,11,10,11,0,1,0,1,0,1
%N A103181 In decimal representation of n: replace all even digits with 0 and all odd digits with 1.
%H A103181 Reinhard Zumkeller, <a href="/A103181/b103181.txt">Table of n, a(n) for n = 0..9999</a>
%F A103181 n = Sum(d(k)*10^k: 0<=d(k)<10) -> a(n) = Sum((d(k) mod 2)*10^k).
%F A103181 a(A014263(n)) = 0. - _Reinhard Zumkeller_, Oct 04 2011
%e A103181 199->'111': a(199)=111; 200->'000': a(200)=0;
%e A103181 299->'011': a(299)=11; 300->'100': a(300)=100.
%t A103181 Table[FromDigits[If[EvenQ[#],0,1]&/@IntegerDigits[n]],{n,0,90}] (* _Harvey P. Dale_, Nov 08 2022 *)
%o A103181 (Haskell)
%o A103181 import Data.List (unfoldr); import Data.Tuple (swap)
%o A103181 a103181_list = map a103181 [0..]
%o A103181 a103181 n = foldl f 0 $ reverse $ unfoldr g n where
%o A103181    f v d = 10 * v + mod d 2
%o A103181    g x = if x == 0 then Nothing else Just $ swap $ divMod x 10
%o A103181 -- _Reinhard Zumkeller_, Oct 04 2011
%o A103181 (PARI) a(n)=subst(Pol(apply(k->k%2, digits(n))),'x,10) \\ _Charles R Greathouse IV_, Jul 16 2013
%o A103181 (Python)
%o A103181 def A103181(n): return int(''.join(str(int(d) % 2) for d in str(n))) # _Chai Wah Wu_, Apr 09 2022
%Y A103181 Cf. A000035, A014263.
%K A103181 nonn,base,easy
%O A103181 0,11
%A A103181 _Reinhard Zumkeller_, Mar 18 2005