login
A344531
a(n) = Sum_{k >= 0} b_k * 2^A061579(k) for any number n with binary expansion Sum_{k >= 0} b_k * 2^k.
3
0, 1, 4, 5, 2, 3, 6, 7, 32, 33, 36, 37, 34, 35, 38, 39, 16, 17, 20, 21, 18, 19, 22, 23, 48, 49, 52, 53, 50, 51, 54, 55, 8, 9, 12, 13, 10, 11, 14, 15, 40, 41, 44, 45, 42, 43, 46, 47, 24, 25, 28, 29, 26, 27, 30, 31, 56, 57, 60, 61, 58, 59, 62, 63, 512, 513, 516
OFFSET
0,3
COMMENTS
This sequence is a self-inverse permutation of the nonnegative integers.
Fixed points correspond to A261195.
FORMULA
a(n) = n iff n belongs to A261195.
A000120(a(n)) = A000120(n).
a(n) < 2^A000217(k) for any n < 2^A000217(k).
EXAMPLE
For n = 42:
- 42 = 2^1 + 2^3 + 2^5,
- A061579(1) = 2,
- A061579(3) = 5,
- A061579(5) = 3,
- so a(42) = 2^2 + 2^5 + 2^3 = 44.
PROG
(PARI) a(n) = { my (v=0, e, t=0, w=1); while (n, n-=2^e=valuation(n, 2); while (e>t+w-1, t+=w; w++); v+=2^(2*t+w-1-e)); v }
CROSSREFS
Cf. A000120, A000217, A061579, A261195 (fixed points).
Sequence in context: A070593 A070599 A057301 * A213171 A261098 A216252
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, May 22 2021
STATUS
approved