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.

A371442 For any positive integer n with binary digits (b_1, ..., b_w) (where b_1 = 1), the binary digits of a(n) are (b_1, b_3, ..., b_{2*ceiling(w/2)-1}); a(0) = 0.

This page as a plain text file.
%I A371442 #33 Mar 28 2024 18:04:09
%S A371442 0,1,1,1,2,3,2,3,2,2,3,3,2,2,3,3,4,5,4,5,6,7,6,7,4,5,4,5,6,7,6,7,4,4,
%T A371442 5,5,4,4,5,5,6,6,7,7,6,6,7,7,4,4,5,5,4,4,5,5,6,6,7,7,6,6,7,7,8,9,8,9,
%U A371442 10,11,10,11,8,9,8,9,10,11,10,11,12,13,12
%N A371442 For any positive integer n with binary digits (b_1, ..., b_w) (where b_1 = 1), the binary digits of a(n) are (b_1, b_3, ..., b_{2*ceiling(w/2)-1}); a(0) = 0.
%C A371442 In other words, we keep odd-indexed bits.
%C A371442 For any v > 0, the value v appears A003945(A070939(v)) times in the sequence.
%H A371442 Rémy Sigrist, <a href="/A371442/b371442.txt">Table of n, a(n) for n = 0..8192</a>
%H A371442 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A371442 a(A000695(n)) = n.
%F A371442 a(A001196(n)) = n.
%F A371442 a(A165199(n)) = a(n).
%e A371442 The first terms, in decimal and in binary, are:
%e A371442   n   a(n)  bin(n)  bin(a(n))
%e A371442   --  ----  ------  ---------
%e A371442    0     0       0          0
%e A371442    1     1       1          1
%e A371442    2     1      10          1
%e A371442    3     1      11          1
%e A371442    4     2     100         10
%e A371442    5     3     101         11
%e A371442    6     2     110         10
%e A371442    7     3     111         11
%e A371442    8     2    1000         10
%e A371442    9     2    1001         10
%e A371442   10     3    1010         11
%e A371442   11     3    1011         11
%e A371442   12     2    1100         10
%e A371442   13     2    1101         10
%e A371442   14     3    1110         11
%e A371442   15     3    1111         11
%t A371442 A371442[n_] := FromDigits[IntegerDigits[n, 2][[1;;-1;;2]], 2];
%t A371442 Array[A371442, 100, 0] (* _Paolo Xausa_, Mar 28 2024 *)
%o A371442 (PARI) a(n) = { my (b = binary(n)); fromdigits(vector(ceil(#b/2), k, b[2*k-1]), 2); }
%o A371442 (Python) def a(n): return int(bin(n)[::2], 2)
%Y A371442 See A371459 for the sequence related to even-indexed bits.
%Y A371442 See A059905 and A063694 for similar sequences.
%Y A371442 Cf. A000695, A001196, A003945, A070939, A165199, A371461.
%K A371442 nonn,base,easy
%O A371442 0,5
%A A371442 _Rémy Sigrist_, Mar 24 2024