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.

A257831 In decimal representation of n: replace each digit with its binary representation.

This page as a plain text file.
%I A257831 #13 May 22 2025 10:21:43
%S A257831 0,1,10,11,100,101,110,111,1000,1001,10,11,110,111,1100,1101,1110,
%T A257831 1111,11000,11001,100,101,1010,1011,10100,10101,10110,10111,101000,
%U A257831 101001,110,111,1110,1111,11100,11101,11110,11111,111000,111001,1000,1001,10010,10011
%N A257831 In decimal representation of n: replace each digit with its binary representation.
%C A257831 a(n) = n iff (largest digit of n) = 1: a(A007088(n)) = A007088(n);
%C A257831 a(n) = A007088(A080719(n)).
%H A257831 Reinhard Zumkeller, <a href="/A257831/b257831.txt">Table of n, a(n) for n = 0..10000</a>
%e A257831 .    n |  dec    -->  bin         |     a(n) |  A080719(n)
%e A257831 . -----+--------------------------+----------+------------
%e A257831 .  100 |  [1,0,0]  |  [1,0,0]     |     100  |          4
%e A257831 .  101 |  [1,0,1]  |  [1,0,1]     |     101  |          5
%e A257831 .  102 |  [1,0,2]  |  [1,0,10]    |    1010  |         10
%e A257831 .  103 |  [1,0,3]  |  [1,0,11]    |    1011  |         11
%e A257831 .  104 |  [1,0,4]  |  [1,0,100]   |   10100  |         20
%e A257831 .  105 |  [1,0,5]  |  [1,0,101]   |   10101  |         21
%e A257831 .  106 |  [1,0,6]  |  [1,0,110]   |   10110  |         22
%e A257831 .  107 |  [1,0,7]  |  [1,0,111]   |   10111  |         23
%e A257831 .  108 |  [1,0,8]  |  [1,0,1000]  |  101000  |         40
%e A257831 .  109 |  [1,0,9]  |  [1,0,1001]  |  101001  |         41
%e A257831 .  110 |  [1,1,0]  |  [1,1,0]     |     110  |          6
%e A257831 .  111 |  [1,1,1]  |  [1,1,1]     |     111  |          7
%e A257831 .  112 |  [1,1,2]  |  [1,1,10]    |    1110  |         14
%e A257831 .  113 |  [1,1,3]  |  [1,1,11]    |    1111  |         15
%e A257831 .  114 |  [1,1,4]  |  [1,1,100]   |   11100  |         28
%e A257831 .  115 |  [1,1,5]  |  [1,1,101]   |   11101  |         29
%e A257831 .  116 |  [1,1,6]  |  [1,1,110]   |   11110  |         30
%e A257831 .  117 |  [1,1,7]  |  [1,1,111]   |   11111  |         31
%e A257831 .  118 |  [1,1,8]  |  [1,1,1000]  |  111000  |         56
%e A257831 .  119 |  [1,1,9]  |  [1,1,1001]  |  111001  |         57
%e A257831 .  120 |  [1,2,0]  |  [1,10,0]    |    1100  |         12
%e A257831 .  121 |  [1,2,1]  |  [1,10,1]    |    1101  |         13
%e A257831 .  122 |  [1,2,2]  |  [1,10,10]   |   11010  |         26
%e A257831 .  123 |  [1,2,3]  |  [1,10,11]   |   11011  |         27
%e A257831 .  124 |  [1,2,4]  |  [1,10,100]  |  110100  |         52
%e A257831 .  125 |  [1,2,5]  |  [1,10,101]  |  110101  |         53  .
%t A257831 Table[FromDigits[Flatten[IntegerDigits[#,2]&/@IntegerDigits[n]]],{n,0,50}] (* _Harvey P. Dale_, Jun 06 2020 *)
%o A257831 (Haskell)
%o A257831 import Data.Maybe (mapMaybe)
%o A257831 a257831 = foldr (\b v -> 10 * v + b) 0 .
%o A257831            concat . mapMaybe (flip lookup bin) . a031298_row
%o A257831             where bin = zip [0..9] a030308_tabf
%o A257831 (Python)
%o A257831 def A257831(n):
%o A257831     return int(''.join((format(int(d),'b') for d in str(n))))
%o A257831 # _Chai Wah Wu_, May 10 2015
%Y A257831 Cf. A007088, A030308, A031298, A080719.
%K A257831 nonn,base
%O A257831 0,3
%A A257831 _Reinhard Zumkeller_, May 10 2015