login
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}).
2
1, 6, 3, 14, 29, 28, 7, 30, 123, 122, 61, 60, 121, 120, 15, 62, 503, 502, 251, 250, 501, 500, 125, 124, 499, 498, 249, 248, 497, 496, 31, 126, 2031, 2030, 1015, 1014, 2029, 2028, 507, 506, 2027, 2026, 1013, 1012, 2025, 2024, 253, 252, 2023, 2022, 1011, 1010
OFFSET
1,2
COMMENTS
This sequence is related to A341694 (see Formula section).
All terms are distinct.
If a(n) > n, then a(n) does not appear in A341699.
FORMULA
A341694(a(n), k) = A341694(n, k+1).
a(n) = n iff n belongs to A126646.
A090996(a(n)) = A070939(n).
A090996(a(n)) > A070939(a(n)) / 2.
A005811(a(n)) = A005811(n).
EXAMPLE
The first terms, in decimal and in binary, are:
n a(n) bin(n) bin(a(n))
-- ---- ------ ---------
1 1 1 1
2 6 10 110
3 3 11 11
4 14 100 1110
5 29 101 11101
6 28 110 11100
7 7 111 111
8 30 1000 11110
9 123 1001 1111011
10 122 1010 1111010
11 61 1011 111101
12 60 1100 111100
13 121 1101 1111001
14 120 1110 1111000
15 15 1111 1111
PROG
(PARI) toruns(n) = { my (r=[]); while (n, my (v=valuation(n+n%2, 2)); n\=2^v; r=concat(v, r)); r }
fromruns(r) = { my (v=0); for (k=1, #r, v=(v+k%2)*2^r[k]-k%2); v }
a(n) = { my (r=toruns(n)); fromruns(concat(vecsum(r), r[1..#r-1])) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Feb 18 2021
STATUS
approved