login
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: A371479 A057756 A340477 * A160051 A351298 A082746
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jan 06 2021
STATUS
approved