A257831 In decimal representation of n: replace each digit with its binary representation.
0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 10, 11, 110, 111, 1100, 1101, 1110, 1111, 11000, 11001, 100, 101, 1010, 1011, 10100, 10101, 10110, 10111, 101000, 101001, 110, 111, 1110, 1111, 11100, 11101, 11110, 11111, 111000, 111001, 1000, 1001, 10010, 10011
Offset: 0
Examples
. n | dec --> bin | a(n) | A080719(n) . -----+--------------------------+----------+------------ . 100 | [1,0,0] | [1,0,0] | 100 | 4 . 101 | [1,0,1] | [1,0,1] | 101 | 5 . 102 | [1,0,2] | [1,0,10] | 1010 | 10 . 103 | [1,0,3] | [1,0,11] | 1011 | 11 . 104 | [1,0,4] | [1,0,100] | 10100 | 20 . 105 | [1,0,5] | [1,0,101] | 10101 | 21 . 106 | [1,0,6] | [1,0,110] | 10110 | 22 . 107 | [1,0,7] | [1,0,111] | 10111 | 23 . 108 | [1,0,8] | [1,0,1000] | 101000 | 40 . 109 | [1,0,9] | [1,0,1001] | 101001 | 41 . 110 | [1,1,0] | [1,1,0] | 110 | 6 . 111 | [1,1,1] | [1,1,1] | 111 | 7 . 112 | [1,1,2] | [1,1,10] | 1110 | 14 . 113 | [1,1,3] | [1,1,11] | 1111 | 15 . 114 | [1,1,4] | [1,1,100] | 11100 | 28 . 115 | [1,1,5] | [1,1,101] | 11101 | 29 . 116 | [1,1,6] | [1,1,110] | 11110 | 30 . 117 | [1,1,7] | [1,1,111] | 11111 | 31 . 118 | [1,1,8] | [1,1,1000] | 111000 | 56 . 119 | [1,1,9] | [1,1,1001] | 111001 | 57 . 120 | [1,2,0] | [1,10,0] | 1100 | 12 . 121 | [1,2,1] | [1,10,1] | 1101 | 13 . 122 | [1,2,2] | [1,10,10] | 11010 | 26 . 123 | [1,2,3] | [1,10,11] | 11011 | 27 . 124 | [1,2,4] | [1,10,100] | 110100 | 52 . 125 | [1,2,5] | [1,10,101] | 110101 | 53 .
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
Programs
-
Haskell
import Data.Maybe (mapMaybe) a257831 = foldr (\b v -> 10 * v + b) 0 . concat . mapMaybe (flip lookup bin) . a031298_row where bin = zip [0..9] a030308_tabf
-
Mathematica
Table[FromDigits[Flatten[IntegerDigits[#,2]&/@IntegerDigits[n]]],{n,0,50}] (* Harvey P. Dale, Jun 06 2020 *)
-
Python
def A257831(n): return int(''.join((format(int(d),'b') for d in str(n)))) # Chai Wah Wu, May 10 2015
Comments