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.

A341746 If the runs in the binary expansion of n are (r_1, ..., r_k), then the runs in the binary expansion of a(n) are (r_1 + ... + r_k, r_1, ..., r_{k-1}).

This page as a plain text file.
%I A341746 #14 Feb 19 2021 12:05:56
%S A341746 1,6,3,14,29,28,7,30,123,122,61,60,121,120,15,62,503,502,251,250,501,
%T A341746 500,125,124,499,498,249,248,497,496,31,126,2031,2030,1015,1014,2029,
%U A341746 2028,507,506,2027,2026,1013,1012,2025,2024,253,252,2023,2022,1011,1010
%N A341746 If the runs in the binary expansion of n are (r_1, ..., r_k), then the runs in the binary expansion of a(n) are (r_1 + ... + r_k, r_1, ..., r_{k-1}).
%C A341746 This sequence is related to A341694 (see Formula section).
%C A341746 All terms are distinct.
%C A341746 If a(n) > n, then a(n) does not appear in A341699.
%H A341746 Rémy Sigrist, <a href="/A341746/b341746.txt">Table of n, a(n) for n = 1..8192</a>
%H A341746 Rémy Sigrist, <a href="/A341746/a341746.png">Binary plot of the first 255 terms</a>
%H A341746 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A341746 A341694(a(n), k) = A341694(n, k+1).
%F A341746 a(n) = n iff n belongs to A126646.
%F A341746 A090996(a(n)) = A070939(n).
%F A341746 A090996(a(n)) > A070939(a(n)) / 2.
%F A341746 A005811(a(n)) = A005811(n).
%e A341746 The first terms, in decimal and in binary, are:
%e A341746   n   a(n)  bin(n)  bin(a(n))
%e A341746   --  ----  ------  ---------
%e A341746    1     1       1          1
%e A341746    2     6      10        110
%e A341746    3     3      11         11
%e A341746    4    14     100       1110
%e A341746    5    29     101      11101
%e A341746    6    28     110      11100
%e A341746    7     7     111        111
%e A341746    8    30    1000      11110
%e A341746    9   123    1001    1111011
%e A341746   10   122    1010    1111010
%e A341746   11    61    1011     111101
%e A341746   12    60    1100     111100
%e A341746   13   121    1101    1111001
%e A341746   14   120    1110    1111000
%e A341746   15    15    1111       1111
%o A341746 (PARI) toruns(n) = { my (r=[]); while (n, my (v=valuation(n+n%2, 2)); n\=2^v; r=concat(v, r)); r }
%o A341746 fromruns(r) = { my (v=0); for (k=1, #r, v=(v+k%2)*2^r[k]-k%2); v }
%o A341746 a(n) = { my (r=toruns(n)); fromruns(concat(vecsum(r), r[1..#r-1])) }
%Y A341746 Cf. A005811, A070939, A090996, A126646, A341694, A341699.
%K A341746 nonn,base
%O A341746 1,2
%A A341746 _Rémy Sigrist_, Feb 18 2021