login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A340401
For any number n >= 0 with binary expansion Sum_{k = 0..w} b(k)*2^k, a(n) = (b(0)*A340399(0)) XOR ... XOR (b(w)*A340399(w)) (where XOR denotes the bitwise XOR operator).
3
0, 1, 2, 3, 5, 4, 7, 6, 8, 9, 10, 11, 13, 12, 15, 14, 21, 20, 23, 22, 16, 17, 18, 19, 29, 28, 31, 30, 24, 25, 26, 27, 34, 35, 32, 33, 39, 38, 37, 36, 42, 43, 40, 41, 47, 46, 45, 44, 55, 54, 53, 52, 50, 51, 48, 49, 63, 62, 61, 60, 58, 59, 56, 57, 89, 88, 91, 90
OFFSET
0,3
COMMENTS
This sequence is a permutation of the nonnegative integers (with inverse A340477) that preserves the number of binary digits.
EXAMPLE
For n = 41:
- 41 = 2^5 + 2^3 + 2^0,
- so a(41) = A340399(5) XOR A340399(3) XOR A340399(0) = 34 XOR 8 XOR 1 = 43.
PROG
(PARI) See Links section.
CROSSREFS
Cf. A340399, A340402, A340477 (inverse).
Sequence in context: A057756 A378785 A340477 * A160051 A351298 A082746
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jan 06 2021
STATUS
approved