The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A065031 In the decimal expansion of n, replace each odd digit with 1 and each even digit with 2. 6

%I

%S 2,1,2,1,2,1,2,1,2,1,12,11,12,11,12,11,12,11,12,11,22,21,22,21,22,21,

%T 22,21,22,21,12,11,12,11,12,11,12,11,12,11,22,21,22,21,22,21,22,21,22,

%U 21,12,11,12,11,12,11,12,11,12,11,22,21,22,21,22,21,22,21,22,21

%N In the decimal expansion of n, replace each odd digit with 1 and each even digit with 2.

%C A196563(a(n)) = A196563(n); A196564(a(n)) = A196564(n).

%H Reinhard Zumkeller, <a href="/A065031/b065031.txt">Table of n, a(n) for n = 0..10000</a>

%e a(123)=121 because 1 and 3 are odd and 2 is even.

%t Table[FromDigits[If[OddQ[#],1,2]&/@IntegerDigits[n]],{n,0,120}] (* _Harvey P. Dale_, Jun 08 2014 *)

%o a065031 n = f n where

%o f x | x < 10 = 2 - x `mod` 2

%o | otherwise = 10 * (f x') + 2 - m `mod` 2

%o where (x',m) = divMod x 10

%o -- _Reinhard Zumkeller_, Feb 22 2012

%K base,nonn

%O 0,1

%A _Santi Spadaro_, Nov 03 2001

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified June 13 17:14 EDT 2021. Contains 345008 sequences. (Running on oeis4.)